[pygobject] Fix memory leak in _pygi_argument_to_object()
- From: Martin Pitt <martinpitt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] Fix memory leak in _pygi_argument_to_object()
- Date: Mon, 3 Sep 2012 05:20:23 +0000 (UTC)
commit 65bfbc624bc9da6e18ff2945b14099ab8eeb7601
Author: Alban Browaeys <prahal yahoo com>
Date: Wed Aug 29 21:24:17 2012 +0200
Fix memory leak in _pygi_argument_to_object()
Avoid leaking the item_type_info when breaking out of the
switch in _pygi_argument_to_object() for unmarshalling arrays.
https://bugzilla.gnome.org/show_bug.cgi?id=682979
gi/pygi-argument.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/gi/pygi-argument.c b/gi/pygi-argument.c
index 3527002..1560556 100644
--- a/gi/pygi-argument.c
+++ b/gi/pygi-argument.c
@@ -1681,20 +1681,24 @@ _pygi_argument_to_object (GIArgument *arg,
/* Return as a byte array */
if (arg->v_pointer == NULL) {
object = PYGLIB_PyBytes_FromString ("");
+ g_base_info_unref ( (GIBaseInfo *) item_type_info);
break;
}
object = PYGLIB_PyBytes_FromStringAndSize(array->data, array->len);
+ g_base_info_unref ( (GIBaseInfo *) item_type_info);
break;
} else {
if (arg->v_pointer == NULL) {
object = PyList_New (0);
+ g_base_info_unref ( (GIBaseInfo *) item_type_info);
break;
}
object = PyList_New (array->len);
if (object == NULL) {
+ g_base_info_unref ( (GIBaseInfo *) item_type_info);
break;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]