diff options
author | Felipe Oliveira Carvalho <felipekde@gmail.com> | 2014-05-28 19:41:01 -0300 |
---|---|---|
committer | Felipe Oliveira Carvalho <felipekde@gmail.com> | 2014-06-16 01:31:35 -0300 |
commit | 2d092cc2291224418dbb6d56bdf1f9f31362d511 (patch) | |
tree | c954f5cd5a37234c0eba726c2bb666a05800252b /src/nvim/eval.c | |
parent | 48fc1602bef4d74e3510b549d328127386261f06 (diff) | |
download | rneovim-2d092cc2291224418dbb6d56bdf1f9f31362d511.tar.gz rneovim-2d092cc2291224418dbb6d56bdf1f9f31362d511.tar.bz2 rneovim-2d092cc2291224418dbb6d56bdf1f9f31362d511.zip |
No OOM in dictitem_copy
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 3c79600f23..a97bbc4871 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -5692,7 +5692,7 @@ dictitem_T *dictitem_alloc(char_u *key) FUNC_ATTR_NONNULL_RET /* * Make a copy of a Dictionary item. */ -static dictitem_T *dictitem_copy(dictitem_T *org) +static dictitem_T *dictitem_copy(dictitem_T *org) FUNC_ATTR_NONNULL_RET { dictitem_T *di = xmalloc(sizeof(dictitem_T) + STRLEN(org->di_key)); @@ -8186,7 +8186,7 @@ void dict_extend(dict_T *d1, dict_T *d2, char_u *action) } if (di1 == NULL) { di1 = dictitem_copy(HI2DI(hi2)); - if (di1 != NULL && dict_add(d1, di1) == FAIL) + if (dict_add(d1, di1) == FAIL) dictitem_free(di1); } else if (*action == 'e') { EMSG2(_("E737: Key already exists: %s"), hi2->hi_key); |