From f3be5b643183867a024c5917a9c96a30f4a179b6 Mon Sep 17 00:00:00 2001 From: Michael Snyder Date: Fri, 11 Mar 2011 22:01:30 +0000 Subject: [PATCH] 2011-03-11 Michael Snyder * python/py-breakpoint.c (bppy_set_condition): Stop memory leak. --- gdb/ChangeLog | 2 ++ gdb/python/py-breakpoint.c | 4 ++++ 2 files changed, 6 insertions(+) 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; -- 2.30.2