* py-cmd.c (gdbpy_string_to_argv): Check result of

PyList_New.
This commit is contained in:
Tom Tromey 2013-05-20 20:14:51 +00:00
parent 0430e8cba9
commit 3919fd966c
2 changed files with 7 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2013-05-20 Tom Tromey <tromey@redhat.com>
* py-cmd.c (gdbpy_string_to_argv): Check result of
PyList_New.
2013-05-20 Tom Tromey <tromey@redhat.com>
* python/python.c (before_prompt_hook): Add cleanup to

View File

@ -668,6 +668,8 @@ gdbpy_string_to_argv (PyObject *self, PyObject *args)
return NULL;
py_argv = PyList_New (0);
if (py_argv == NULL)
return NULL;
/* buildargv uses NULL to represent an empty argument list, but we can't use
that in Python. Instead, if ARGS is "" then return an empty list.