[pygobject] Fix invalid memory access handling errors when registering an enum type
- From: Mike Gorse <mgorse src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] Fix invalid memory access handling errors when registering an enum type
- Date: Thu, 10 Jan 2013 20:33:02 +0000 (UTC)
commit aa7f6cd12fe403acb2cffc7890724af7abb9b990
Author: Mike Gorse <mgorse suse com>
Date: Thu Jan 10 14:11:56 2013 -0600
Fix invalid memory access handling errors when registering an enum type
Don't free the name until we are done with it.
gi/gimodule.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gi/gimodule.c b/gi/gimodule.c
index 8246d29..bb5c306 100644
--- a/gi/gimodule.c
+++ b/gi/gimodule.c
@@ -133,10 +133,10 @@ _wrap_pyg_enum_register_new_gtype_and_add (PyObject *self,
g_free ((gchar *) enum_value->value_nick);
}
+ PyErr_Format (PyExc_RuntimeError, "Unable to register enum '%s'", full_name);
+
g_free (g_enum_values);
g_free (full_name);
-
- PyErr_Format (PyExc_RuntimeError, "Unable to register enum '%s'", full_name);
return NULL;
}
@@ -249,10 +249,10 @@ _wrap_pyg_flags_register_new_gtype_and_add (PyObject *self,
g_free ((gchar *) flags_value->value_nick);
}
+ PyErr_Format (PyExc_RuntimeError, "Unable to register flags '%s'", full_name);
+
g_free (g_flags_values);
g_free (full_name);
-
- PyErr_Format (PyExc_RuntimeError, "Unable to register flags '%s'", full_name);
return NULL;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]