From: Bram Moolenaar Date: Wed, 18 Jan 2023 12:45:30 +0000 (+0000) Subject: patch 9.0.1216: Coverity warns for ignoring return value X-Git-Tag: v9.0.1216 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=64f1c4152e939ca41d57d5b4376be522736ba22a;p=vim patch 9.0.1216: Coverity warns for ignoring return value Problem: Coverity warns for ignoring return value. Solution: Break out of loop if function fails. --- diff --git a/src/mbyte.c b/src/mbyte.c index 4f6c8502a..6d7137ed5 100644 --- a/src/mbyte.c +++ b/src/mbyte.c @@ -5756,11 +5756,14 @@ f_getcellwidths(typval_T *argvars UNUSED, typval_T *rettv) list_T *entry = list_alloc(); if (entry == NULL) break; - list_append_number(entry, (varnumber_T)cw_table[i].first); - list_append_number(entry, (varnumber_T)cw_table[i].last); - list_append_number(entry, (varnumber_T)cw_table[i].width); - - list_append_list(rettv->vval.v_list, entry); + if (list_append_number(entry, (varnumber_T)cw_table[i].first) == FAIL + || list_append_number(entry, (varnumber_T)cw_table[i].last) == FAIL + || list_append_number(entry, (varnumber_T)cw_table[i].width) == FAIL + || list_append_list(rettv->vval.v_list, entry) == FAIL) + { + list_free(entry); + break; + } } } diff --git a/src/version.c b/src/version.c index 5565ccbe9..d63abc349 100644 --- a/src/version.c +++ b/src/version.c @@ -695,6 +695,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1216, /**/ 1215, /**/