diff options
author | Kalev Lember <klember@redhat.com> | 2018-12-14 12:16:21 +0100 |
---|---|---|
committer | Kalev Lember <klember@redhat.com> | 2018-12-14 13:44:33 +0100 |
commit | 30db8cd59530daf89567e9da0875b31b3a2a4cf9 (patch) | |
tree | 793ee7c79c2c0db58bdb55a050cdca141b1fabd6 /libappstream-glib | |
parent | 24913fb9ac74f671fdba7547049bcaa0899704ee (diff) | |
download | appstream-glib-30db8cd59530daf89567e9da0875b31b3a2a4cf9.tar.gz |
store: trivial: Fix a possibly memory leak in as_store_validate
When returning early we were leaking GPtrArray *probs which never got
freed. Change it to use g_autoptr to avoid that.
Diffstat (limited to 'libappstream-glib')
-rw-r--r-- | libappstream-glib/as-store.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libappstream-glib/as-store.c b/libappstream-glib/as-store.c index 0308585..e572374 100644 --- a/libappstream-glib/as-store.c +++ b/libappstream-glib/as-store.c @@ -3623,7 +3623,7 @@ as_store_validate (AsStore *store, guint32 flags, GError **error) { AsStorePrivate *priv = GET_PRIVATE (store); AsApp *app; - GPtrArray *probs; + g_autoptr(GPtrArray) probs = NULL; guint i; g_autoptr(GHashTable) hash_names = NULL; g_autoptr(GPtrArray) apps = NULL; @@ -3844,7 +3844,7 @@ as_store_validate (AsStore *store, guint32 flags, GError **error) } } } - return probs; + return g_steal_pointer (&probs); } static void |