mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 7.4.1156
Problem: Coverity warns for NULL pointer and ignoring return value. Solution: Check for NULL pointer. When dict_add() returns FAIL free the item.
This commit is contained in:
parent
64922b9014
commit
2dedb45260
@ -318,7 +318,8 @@ json_decode_object(js_read_T *reader, typval_T *res)
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
di->di_tv = item;
|
di->di_tv = item;
|
||||||
dict_add(res->vval.v_dict, di);
|
if (dict_add(res->vval.v_dict, di) == FAIL)
|
||||||
|
dictitem_free(di);
|
||||||
|
|
||||||
json_skip_white(reader);
|
json_skip_white(reader);
|
||||||
p = reader->js_buf + reader->js_used;
|
p = reader->js_buf + reader->js_used;
|
||||||
@ -398,6 +399,9 @@ json_decode_string(js_read_T *reader, typval_T *res)
|
|||||||
{
|
{
|
||||||
++reader->js_used;
|
++reader->js_used;
|
||||||
res->v_type = VAR_STRING;
|
res->v_type = VAR_STRING;
|
||||||
|
if (ga.ga_data == NULL)
|
||||||
|
res->vval.v_string = NULL;
|
||||||
|
else
|
||||||
res->vval.v_string = vim_strsave(ga.ga_data);
|
res->vval.v_string = vim_strsave(ga.ga_data);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -741,6 +741,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1156,
|
||||||
/**/
|
/**/
|
||||||
1155,
|
1155,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user