From: Michael Snyder Date: Fri, 11 Mar 2011 22:01:30 +0000 (+0000) Subject: 2011-03-11 Michael Snyder X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f3be5b643183867a024c5917a9c96a30f4a179b6;p=binutils-gdb.git 2011-03-11 Michael Snyder * python/py-breakpoint.c (bppy_set_condition): Stop memory leak. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 13f9b162c1d..898ff019aeb 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,7 @@ 2011-03-11 Michael Snyder + * python/py-breakpoint.c (bppy_set_condition): Stop memory leak. + * python/py-breakpoint.c (bppy_get_commands): Fix memory leak. * top.c (set_verbose): Assert showcmd was found. diff --git a/gdb/python/py-breakpoint.c b/gdb/python/py-breakpoint.c index c8308b99a9d..bfebb1a2f04 100644 --- a/gdb/python/py-breakpoint.c +++ b/gdb/python/py-breakpoint.c @@ -457,6 +457,10 @@ bppy_set_condition (PyObject *self, PyObject *newvalue, void *closure) { set_breakpoint_condition (self_bp->bp, exp, 0); } + + if (newvalue != Py_None) + xfree (exp); + GDB_PY_SET_HANDLE_EXCEPTION (except); return 0;