This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFA] py-inferior.c, check return value of PyList_Append
- From: Michael Snyder <msnyder at vmware dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Cc: Phil Muldoon <pmuldoon at redhat dot com>
- Date: Wed, 02 Mar 2011 10:42:55 -0800
- Subject: [RFA] py-inferior.c, check return value of PyList_Append
Just making this up as I go, here, need a review.
Should anybody get a DECREF?
2011-03-02 Michael Snyder <msnyder@vmware.com>
* py-inferior.c (inferior_to_inferior_object): Check return
value from PyList_Append.
Index: python/py-inferior.c
===================================================================
RCS file: /cvs/src/src/gdb/python/py-inferior.c,v
retrieving revision 1.5
diff -u -p -u -p -r1.5 py-inferior.c
--- python/py-inferior.c 4 Feb 2011 21:54:16 -0000 1.5
+++ python/py-inferior.c 2 Mar 2011 18:39:54 -0000
@@ -326,7 +326,9 @@ build_inferior_list (struct inferior *in
PyObject *list = arg;
PyObject *inferior = inferior_to_inferior_object (inf);
- PyList_Append (list, inferior);
+ if (PyList_Append (list, inferior))
+ return 1;
+
return 0;
}