2011-03-11 Michael Snyder <msnyder@vmware.com>
authorMichael Snyder <msnyder@vmware.com>
Fri, 11 Mar 2011 22:01:30 +0000 (22:01 +0000)
committerMichael Snyder <msnyder@vmware.com>
Fri, 11 Mar 2011 22:01:30 +0000 (22:01 +0000)
* python/py-breakpoint.c (bppy_set_condition): Stop memory leak.

gdb/ChangeLog
gdb/python/py-breakpoint.c

index 13f9b162c1dc9c60edadff90774698aa6d1c8ab9..898ff019aeb2b9de16eb94245d37fc57459430c1 100644 (file)
@@ -1,5 +1,7 @@
 2011-03-11  Michael Snyder  <msnyder@vmware.com>
 
+       * 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.
index c8308b99a9dcb103fbe469ab887105cafd28dcd1..bfebb1a2f0469812832266d4805ad648196c36b9 100644 (file)
@@ -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;