Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] py-inferior.c, check return value of PyList_Append
@ 2011-03-02 18:44 Michael Snyder
  2011-03-02 20:27 ` Tom Tromey
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Snyder @ 2011-03-02 18:44 UTC (permalink / raw)
  To: gdb-patches; +Cc: Phil Muldoon

[-- Attachment #1: Type: text/plain, Size: 80 bytes --]

Just making this up as I go, here, need a review.
Should anybody get a DECREF?


[-- Attachment #2: py-inferior.txt --]
[-- Type: text/plain, Size: 708 bytes --]

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

^ permalink raw reply	[flat|nested] 6+ messages in thread
* [RFA] py-inferior.c, check return value of PyList_Append
@ 2011-03-02 18:43 Michael Snyder
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Snyder @ 2011-03-02 18:43 UTC (permalink / raw)
  To: gdb-patches; +Cc: Phil Muldoon

[-- Attachment #1: Type: text/plain, Size: 80 bytes --]

Just making this up as I go, here, need a review.
Should anybody get a DECREF?


[-- Attachment #2: py-inferior.txt --]
[-- Type: text/plain, Size: 708 bytes --]

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-03-02 21:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-02 18:44 [RFA] py-inferior.c, check return value of PyList_Append Michael Snyder
2011-03-02 20:27 ` Tom Tromey
2011-03-02 20:40   ` Michael Snyder
2011-03-02 20:56     ` Tom Tromey
2011-03-02 21:21       ` Michael Snyder
  -- strict thread matches above, loose matches on Subject: below --
2011-03-02 18:43 Michael Snyder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox