eval/typval: Remove FUNC_ATTR_MALLOC from tv_dict_item_copy

Allocated storage may receive pointer to the list after tv_copy().
This commit is contained in:
ZyX
2017-04-15 19:16:40 +03:00
parent b08b71c728
commit b9004d7448

View File

@@ -1011,7 +1011,6 @@ void tv_dict_item_free(dictitem_T *const item)
/// @return [allocated] new dictionary item. /// @return [allocated] new dictionary item.
static dictitem_T *tv_dict_item_copy(dictitem_T *const di) static dictitem_T *tv_dict_item_copy(dictitem_T *const di)
FUNC_ATTR_NONNULL_RET FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_RET FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT
FUNC_ATTR_MALLOC
{ {
dictitem_T *const new_di = tv_dict_item_alloc((const char *)di->di_key); dictitem_T *const new_di = tv_dict_item_alloc((const char *)di->di_key);
tv_copy(&di->di_tv, &new_di->di_tv); tv_copy(&di->di_tv, &new_di->di_tv);