summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Reis <kiko@src.gnome.org>2003-12-05 12:19:18 +0000
committerChristian Reis <kiko@src.gnome.org>2003-12-05 12:19:18 +0000
commitb4580425b553a640cd5bf85f5a7ee97bb73e5b40 (patch)
tree40ff44a26c3fd1cc4078dcb374d3fb78462a1384
parent4567fd2a9515c7a68246deb8c633e87b534b2b03 (diff)
downloadpygtk-b4580425b553a640cd5bf85f5a7ee97bb73e5b40.tar.gz
Avoid leakage in _wrap_gtk_radio_button_group by PyDECREFing as
necessary. Thanks to Johan for pointing this out.
-rw-r--r--gtkmodule.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gtkmodule.c b/gtkmodule.c
index 6da85774..a00c0769 100644
--- a/gtkmodule.c
+++ b/gtkmodule.c
@@ -5228,7 +5228,12 @@ _wrap_gtk_radio_button_group(PyObject *self, PyObject *args)
return NULL;
for (tmp = buttons; tmp != NULL; tmp = tmp->next) {
PyObject *button = PyGtk_New(tmp->data);
+ if (!button) {
+ Py_DECREF(button);
+ return NULL;
+ }
PyList_Append(ret, button);
+ Py_DECREF(button);
}
return ret;
}