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 4f6c850..6d7137e 100644
--- a/src/mbyte.c
+++ b/src/mbyte.c
@@ -5756,11 +5756,14 @@
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;
+ }
}
}