From 9f28953f0c1e3d9fffd49af76503f54eaa279acb Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 26 Aug 2016 16:39:03 +0200 Subject: patch 7.4.2257 Problem: Coverity complains about not checking for NULL. Solution: Check for out of memory. --- src/if_py_both.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/if_py_both.h') diff --git a/src/if_py_both.h b/src/if_py_both.h index 35ad5d03c6..c44fc93acb 100644 --- a/src/if_py_both.h +++ b/src/if_py_both.h @@ -3009,9 +3009,9 @@ FunctionAttr(FunctionObject *self, char *name) return PyString_FromString((char *)(self->name)); else if (strcmp(name, "args") == 0) { - if (self->argv == NULL) + if (self->argv == NULL || (list = list_alloc()) == NULL) return AlwaysNone(NULL); - list = list_alloc(); + for (i = 0; i < self->argc; ++i) list_append_tv(list, &self->argv[i]); return NEW_LIST(list); -- cgit v1.2.3