* py-cmd.c (gdbpy_string_to_argv): Check result of
authorTom Tromey <tromey@redhat.com>
Mon, 20 May 2013 20:14:51 +0000 (20:14 +0000)
committerTom Tromey <tromey@redhat.com>
Mon, 20 May 2013 20:14:51 +0000 (20:14 +0000)
PyList_New.

gdb/ChangeLog
gdb/python/py-cmd.c

index 34a73f6..a9f4354 100644 (file)
@@ -1,5 +1,10 @@
 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
        decref 'hook'.
 
index 3da9960..ca9e415 100644 (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.