diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-04-15 21:47:54 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-04-15 21:47:54 +0200 |
commit | fe4b18640656ddea41f60cf7a76956c9cc5494d6 (patch) | |
tree | ed50f3f84c7d872656715b5da79fadb7f8b38a93 /src/if_py_both.h | |
parent | 95509e18f8806046eeee27482c77666bbec515da (diff) |
patch 7.4.1747v7.4.1747
Problem: Coverity: missing check for NULL pointer.
Solution: Check for out of memory.
Diffstat (limited to 'src/if_py_both.h')
-rw-r--r-- | src/if_py_both.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/if_py_both.h b/src/if_py_both.h index c6a8c44635..de3e8680b5 100644 --- a/src/if_py_both.h +++ b/src/if_py_both.h @@ -2922,6 +2922,13 @@ FunctionConstructor(PyTypeObject *subtype, PyObject *args, PyObject *kwargs) if (argc != 0) { argv = PyMem_New(typval_T, (size_t) argc); + if (argv == NULL) + { + PyErr_NoMemory(); + dict_unref(selfdict); + list_unref(argslist); + return NULL; + } curtv = argv; for (li = argslist->lv_first; li != NULL; li = li->li_next) copy_tv(&li->li_tv, curtv++); |