summaryrefslogtreecommitdiffstats
path: root/bindings
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2009-04-30 14:58:23 +0000
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2009-04-30 14:58:23 +0000
commit7e4a554d61314eca12247b419080e7a09f5b3309 (patch)
tree5672d94fc3bca919d781fd2d2cdb6e12923d7422 /bindings
parent1b0d28b1029fe9214000467adb6ffe2c5175fb27 (diff)
downloadlasso-7e4a554d61314eca12247b419080e7a09f5b3309.tar.gz
lasso-7e4a554d61314eca12247b419080e7a09f5b3309.tar.xz
lasso-7e4a554d61314eca12247b419080e7a09f5b3309.zip
Fix leak in python binding
* bindings/python/wrapper_top.c: keep a pointer on beginning of list to free it.
Diffstat (limited to 'bindings')
-rw-r--r--bindings/python/wrapper_top.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bindings/python/wrapper_top.c b/bindings/python/wrapper_top.c
index 8c2d584a..e71c5fa2 100644
--- a/bindings/python/wrapper_top.c
+++ b/bindings/python/wrapper_top.c
@@ -46,14 +46,14 @@ noneRef() {
static PyObject*
get_dict_from_hashtable_of_objects(GHashTable *value)
{
- GList *keys;
+ GList *keys, *begin;
PyObject *dict,*proxy;
GObject *item_value;
PyObject *item;
dict = PyDict_New();
- keys = g_hash_table_get_keys(value);
+ begin = keys = g_hash_table_get_keys(value);
for (; keys; keys = g_list_next(keys)) {
item_value = g_hash_table_lookup(value, keys->data);
if (item_value) {
@@ -64,7 +64,7 @@ get_dict_from_hashtable_of_objects(GHashTable *value)
PyErr_Warn(PyExc_RuntimeWarning, "hashtable contains a null value");
}
}
- g_list_free(keys);
+ g_list_free(begin);
proxy = PyDictProxy_New(dict);
Py_DECREF(dict);