Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [python] [patch] PR python/13316
@ 2011-10-24 12:54 Phil Muldoon
  2011-10-24 13:48 ` Tom Tromey
  0 siblings, 1 reply; 2+ messages in thread
From: Phil Muldoon @ 2011-10-24 12:54 UTC (permalink / raw)
  To: gdb-patches


This patch (found by David Malcolm's GCC plug-in Python reference
check), fixes a case where we do not decrement a value in two branches
of py-param.c:compute_enum_values.

OK?

Cheers,

Phil

--

2011-10-24  Phil Muldoon  <pmuldoon@redhat.com>

        PR python/13316

	* python/py-param.c (compute_enum_values): Decrement decrement
	PyObjects on function exit.
--


Index: python/py-param.c
===================================================================
RCS file: /cvs/src/src/gdb/python/py-param.c,v
retrieving revision 1.14
diff -u -r1.14 py-param.c
--- python/py-param.c	24 Oct 2011 11:39:50 -0000	1.14
+++ python/py-param.c	24 Oct 2011 12:28:52 -0000
@@ -605,9 +605,12 @@
 	  do_cleanups (back_to);
 	  PyErr_SetString (PyExc_RuntimeError, 
 			   _("The enumeration item not a string."));
+	  Py_DECREF (item);
 	  return 0;
 	}
       self->enumeration[i] = python_string_to_host_string (item);
+      Py_DECREF (item);
+
       if (self->enumeration[i] == NULL)
 	{
 	  do_cleanups (back_to);


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

end of thread, other threads:[~2011-10-24 13:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-24 12:54 [python] [patch] PR python/13316 Phil Muldoon
2011-10-24 13:48 ` Tom Tromey

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