mirror of
https://github.com/neovim/neovim.git
synced 2025-10-02 16:08:36 +00:00
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:
@@ -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);
|
||||||
|
Reference in New Issue
Block a user