summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid King <amigadave@amigadave.com>2021-07-14 10:35:52 +0100
committerPatrick Griffis <tingping@tingping.se>2021-08-23 15:57:33 +0000
commitc4d1b44fe0d69a49d70f1b7b287ea2377947703e (patch)
tree616236438b9368ed99753348e9252cb5eb7dd188
parent86a6b8f6e49aaa1e1594bce9bce35c1b2ec6ec11 (diff)
downloadgobject-introspection-c4d1b44fe0d69a49d70f1b7b287ea2377947703e.tar.gz
Fix some small memory leaks
Found by Coverity. https://bugzilla.redhat.com/show_bug.cgi?id=1938851
-rw-r--r--gi/pygflags.c5
-rw-r--r--gi/pygi-info.c1
2 files changed, 5 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;
}
diff --git a/gi/pygi-info.c b/gi/pygi-info.c
index 19894e49..aee5d4db 100644
--- a/gi/pygi-info.c
+++ b/gi/pygi-info.c
@@ -1862,6 +1862,7 @@ _pygi_g_registered_type_info_check_object (GIRegisteredTypeInfo *info,
object_type = (PyTypeObject *) PyObject_Type (object);
if (object_type == NULL) {
+ g_free (type_name_expected);
return -1;
}