[libgfbgraph/fix-mem-leaks] user: Fix memory leak



commit e13c85551b724c8a65cfcf98fe858e463fb00f0a
Author: Leesoo Ahn <yisooan fedoraproject org>
Date:   Wed Oct 9 11:21:15 2019 +0900

    user: Fix memory leak
    
    RestProxyCall instance and private properties must be freed after it is done.
    
    https://developer.gnome.org/rest/unstable/RestProxy.html#rest-proxy-new-call
    
    https://gitlab.gnome.org/GNOME/libgfbgraph/issues/3

 gfbgraph/gfbgraph-user.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/gfbgraph/gfbgraph-user.c b/gfbgraph/gfbgraph-user.c
index 34410b3..17a0241 100644
--- a/gfbgraph/gfbgraph-user.c
+++ b/gfbgraph/gfbgraph-user.c
@@ -120,6 +120,11 @@ gfbgraph_user_class_init (GFBGraphUserClass *klass)
 static void
 gfbgraph_user_finalize (GObject *obj)
 {
+        GFBGraphUserPrivate *priv = GFBGRAPH_USER_GET_PRIVATE (obj);
+
+        g_free (priv->name);
+        g_free (priv->email);
+
         G_OBJECT_CLASS(parent_class)->finalize (obj);
 }
 
@@ -281,6 +286,7 @@ gfbgraph_user_get_me (GFBGraphAuthorizer *authorizer, GError **error)
 
                 g_object_unref (parser);
         }
+        g_object_unref (rest_call);
 
         return me;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]