Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@vmware.com>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Cc: Phil Muldoon <pmuldoon@redhat.com>
Subject: [RFA] py-inferior.c, check return value of PyList_Append
Date: Wed, 02 Mar 2011 18:43:00 -0000	[thread overview]
Message-ID: <4D6E8FAF.8000402@vmware.com> (raw)

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

             reply	other threads:[~2011-03-02 18:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-02 18:43 Michael Snyder [this message]
2011-03-02 18:44 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D6E8FAF.8000402@vmware.com \
    --to=msnyder@vmware.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pmuldoon@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox