summaryrefslogtreecommitdiff
path: root/gi/pygflags.c
diff options
context:
space:
mode:
Diffstat (limited to 'gi/pygflags.c')
-rw-r--r--gi/pygflags.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gi/pygflags.c b/gi/pygflags.c
index a9c443b6..df1280f9 100644
--- a/gi/pygflags.c
+++ b/gi/pygflags.c
@@ -108,10 +108,13 @@ pyg_flags_repr(PyGFlags *self)
tmp = generate_repr(self->gtype, (guint)PyLong_AsUnsignedLongMask ((PyObject*)self));
module = PyObject_GetAttrString ((PyObject *)self, "__module__");
- if (module == NULL)
+ if (module == NULL) {
+ g_free (tmp);
return NULL;
+ }
if (!PyUnicode_Check (module)) {
+ g_free (tmp);
Py_DECREF (module);
return NULL;
}