if (li == NULL)
return;
ret = dict_add_list(retdict, "matches", li);
+ if (ret == FAIL)
+ list_unref(li);
for (idx = 0; ret == OK && idx < ccline->xpc->xp_numfiles; idx++)
list_append_string(li, ccline->xpc->xp_files[idx], -1);
}
if (hunk_dict == NULL)
goto done;
- list_append_dict(l, hunk_dict);
+ if (list_append_dict(l, hunk_dict) == FAIL)
+ dict_unref(hunk_dict);
}
}
else
if (hlarg == NULL || STRICMP(hlarg, HL_TABLE()[i].sg_name) == 0)
{
dict = highlight_get_info(i, resolve_link);
- if (dict != NULL)
- list_append_dict(list, dict);
+ if (dict != NULL && list_append_dict(list, dict) == FAIL)
+ dict_unref(dict);
}
}
}
return;
ret = dict_add_list(retdict, (has_matches && !has_items)
? "matches" : "items", li);
+ if (ret == FAIL)
+ list_unref(li);
}
if (ret == OK && what_flag & CI_WHAT_SELECTED)
if (compl_curr_match != NULL && compl_curr_match->cp_number == -1)
return;
ret = list_append_dict(li, di);
if (ret != OK)
+ {
+ dict_unref(di);
return;
+ }
fill_complete_info_dict(di, match, has_matches && has_items);
}
if (compl_curr_match != NULL
return;
fill_complete_info_dict(di, compl_curr_match, FALSE);
ret = dict_add_dict(retdict, "completed", di);
+ if (ret == FAIL)
+ dict_unref(di);
}
}
}
if (l == NULL)
return;
- dict_add_list(dict, "cmd", l);
+ if (dict_add_list(dict, "cmd", l) == FAIL)
+ {
+ list_unref(l);
+ return;
+ }
if (job->jv_argv != NULL)
for (i = 0; job->jv_argv[i] != NULL; i++)
list_append_string(l, (char_u *)job->jv_argv[i], -1);
list_append_number(l, (varnumber_T)llpos->len);
}
sprintf(buf, "pos%d", i + 1);
- dict_add_list(dict, buf, l);
+ if (dict_add_list(dict, buf, l) == FAIL)
+ list_unref(l);
}
}
else
dict_add_string_len(dict, "conceal", (char_u *)&buf, buflen);
}
# endif
- list_append_dict(rettv->vval.v_list, dict);
+ if (list_append_dict(rettv->vval.v_list, dict) == FAIL)
+ dict_unref(dict);
cur = cur->mit_next;
}
# endif
if (l == NULL)
return FAIL;
- dict_add_list(dict, "submenus", l);
+ if (dict_add_list(dict, "submenus", l) == FAIL)
+ {
+ list_unref(l);
+ return FAIL;
+ }
// get all the children. Skip PopUp[nvoci].
for (topmenu = menu; topmenu != NULL; topmenu = topmenu->next)
if (!menu_is_hidden(topmenu->dname))
if (l == NULL)
return FAIL;
- dict_add_list(dict, "submenus", l);
+ if (dict_add_list(dict, "submenus", l) == FAIL)
+ {
+ list_unref(l);
+ return FAIL;
+ }
child = menu->children;
while (child)
{
if (list == NULL)
return;
- dict_add_list(dict, name, list);
+ if (dict_add_list(dict, name, list) == FAIL)
+ {
+ list_unref(list);
+ return;
+ }
if (array[0] != 1 || array[1] != 1 || array[2] != 1 || array[3] != 1)
for (i = 0; i < 4; ++i)
list_append_number(list, array[i]);
if (list == NULL)
return;
- dict_add_list(dict, "borderhighlight", list);
+ if (dict_add_list(dict, "borderhighlight", list) == FAIL)
+ {
+ list_unref(list);
+ return;
+ }
// When all highlights are NULL (cleared to empty list), return empty list.
if (i == 4)
return;
if (list == NULL)
return;
- dict_add_list(dict, "borderchars", list);
+ if (dict_add_list(dict, "borderchars", list) == FAIL)
+ {
+ list_unref(list);
+ return;
+ }
for (i = 0; i < 8; ++i)
{
len = mb_char2bytes(wp->w_border_char[i], buf);
list = list_alloc();
if (list != NULL)
{
- dict_add_list(dict, "moved", list);
- list_append_number(list, wp->w_popup_lnum);
- list_append_number(list, wp->w_popup_mincol);
- list_append_number(list, wp->w_popup_maxcol);
+ if (dict_add_list(dict, "moved", list) == FAIL)
+ list_unref(list);
+ else
+ {
+ list_append_number(list, wp->w_popup_lnum);
+ list_append_number(list, wp->w_popup_mincol);
+ list_append_number(list, wp->w_popup_maxcol);
+ }
}
list = list_alloc();
if (list == NULL)
return;
- dict_add_list(dict, "mousemoved", list);
+ if (dict_add_list(dict, "mousemoved", list) == FAIL)
+ {
+ list_unref(list);
+ return;
+ }
list_append_number(list, wp->w_popup_mouse_row);
list_append_number(list, wp->w_popup_mouse_mincol);
list_append_number(list, wp->w_popup_mouse_maxcol);
for (n = 0; n < reg->y_size; n++)
list_append_string(list, reg->y_array[n].string, (int)reg->y_array[n].length);
list->lv_lock = VAR_FIXED;
- (void)dict_add_list(v_event, "regcontents", list);
+ if (dict_add_list(v_event, "regcontents", list) == FAIL)
+ list_unref(list);
// register name or empty string for unnamed operation
buf[0] = (char_u)oap->regname;
}
list->lv_lock = VAR_FIXED;
- (void)dict_add_list(v_event, "regcontents", list);
+ if (dict_add_list(v_event, "regcontents", list) == FAIL)
+ list_unref(list);
// register name or empty string for unnamed operation
buf[0] = (char_u)regname;
FOR_ALL_SIGNS_IN_BUF(buf, sign)
{
dict_T *d = sign_get_info(sign);
- if (d != NULL)
- list_append_dict(l, d);
+ if (d != NULL && list_append_dict(l, d) == FAIL)
+ dict_unref(d);
}
}
if (d == NULL)
return;
- list_append_dict(retlist, d);
+ if (list_append_dict(retlist, d) == FAIL)
+ {
+ dict_unref(d);
+ return;
+ }
dict_add_number(d, "bufnr", (long)buf->b_fnum);
if (l == NULL)
return;
- dict_add_list(d, "signs", l);
+ if (dict_add_list(d, "signs", l) == FAIL)
+ {
+ list_unref(l);
+ return;
+ }
sign_entry_T *sign = NULL;
FOR_ALL_SIGNS_IN_BUF(buf, sign)
(lnum == sign->se_lnum && sign_id == sign->se_id))
{
dict_T *sdict = sign_get_info(sign);
- if (sdict != NULL)
- list_append_dict(l, sdict);
+ if (sdict != NULL && list_append_dict(l, sdict) == FAIL)
+ dict_unref(sdict);
}
}
}
? !term->tl_cursor_blink : term->tl_cursor_blink);
dict_add_number(d, "shape", term->tl_cursor_shape);
dict_add_string(d, "color", cursor_color_get(term->tl_cursor_color));
- list_append_dict(l, d);
+ if (list_append_dict(l, d) == FAIL)
+ dict_unref(d);
}
/*
dcell = dict_alloc();
if (dcell == NULL)
break;
- list_append_dict(l, dcell);
+ if (list_append_dict(l, dcell) == FAIL)
+ {
+ dict_unref(dcell);
+ break;
+ }
dict_add_string_len(dcell, "chars", mbs, (int)mbslen);
prop_fill_dict(d, &prop, buf);
if (add_lnum)
dict_add_number(d, "lnum", lnum);
- list_append_dict(retlist, d);
+ if (list_append_dict(retlist, d) == FAIL)
+ dict_unref(d);
}
}
}
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 802,
/**/
801,
/**/