This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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;
 }
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]