From: Michael Snyder <msnyder@vmware.com>
To: Tom Tromey <tromey@redhat.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [RFA] python/py-breakpoint.c (bppy_set_condition): Stop memory leak.
Date: Fri, 11 Mar 2011 22:01:00 -0000 [thread overview]
Message-ID: <4D7A9A24.4050906@vmware.com> (raw)
In-Reply-To: <m3ei6d49k1.fsf@fleche.redhat.com>
[-- Attachment #1: Type: text/plain, Size: 535 bytes --]
Tom Tromey wrote:
>>>>>> "Michael" == Michael Snyder <msnyder@vmware.com> writes:
>
> Michael> 2011-03-11 Michael Snyder <msnyder@vmware.com>
> Michael> * python/py-breakpoint.c (bppy_set_condition): Stop memory leak.
>
> This isn't sufficient to stop the leak.
>
> Michael> GDB_PY_SET_HANDLE_EXCEPTION (except);
>
> This can return.
>
> We aren't really using cleanups in "pure python" functions like this one.
> You can just explicitly xfree `exp' after the TRY_CATCH.
> However, note the `exp = ""' branch.
Like this?
[-- Attachment #2: py-breakpoint4.txt --]
[-- Type: text/plain, Size: 655 bytes --]
2011-03-11 Michael Snyder <msnyder@vmware.com>
* python/py-breakpoint.c (bppy_set_condition): Stop memory leak.
Index: py-breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/python/py-breakpoint.c,v
retrieving revision 1.15
diff -u -p -r1.15 py-breakpoint.c
--- py-breakpoint.c 11 Mar 2011 21:34:34 -0000 1.15
+++ py-breakpoint.c 11 Mar 2011 21:53:40 -0000
@@ -457,6 +457,10 @@ bppy_set_condition (PyObject *self, PyOb
{
set_breakpoint_condition (self_bp->bp, exp, 0);
}
+
+ if (newvalue != Py_None)
+ xfree (exp);
+
GDB_PY_SET_HANDLE_EXCEPTION (except);
return 0;
next prev parent reply other threads:[~2011-03-11 21:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-11 21:42 Michael Snyder
2011-03-11 21:57 ` Tom Tromey
2011-03-11 22:01 ` Michael Snyder [this message]
2011-03-11 22:05 ` Tom Tromey
2011-03-11 22:16 ` 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=4D7A9A24.4050906@vmware.com \
--to=msnyder@vmware.com \
--cc=gdb-patches@sourceware.org \
--cc=tromey@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