Fix a few memory leaks
authorMikael Berthe <mikael@lilotux.net>
Thu, 05 Nov 2015 17:11:35 +0100
changeset 670 88c6aef5ff18
parent 669 e1883e3f9a55
child 671 4046345db060
Fix a few memory leaks
loudmouth/lm-asyncns-resolver.c
--- a/loudmouth/lm-asyncns-resolver.c	Thu Nov 05 13:39:41 2015 +0100
+++ b/loudmouth/lm-asyncns-resolver.c	Thu Nov 05 17:11:35 2015 +0100
@@ -206,6 +206,7 @@
 
     if (!asyncns_resolver_prep (resolver, NULL)) {
         g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_NET, "Signal error\n");
+        g_free (host);
         return;
     }
 
@@ -218,6 +219,8 @@
     asyncns_setuserdata (priv->asyncns_ctx,
                          priv->resolv_query,
                          (gpointer) asyncns_resolver_done);
+
+    g_free (host);
 }
 
 static void
@@ -300,6 +303,10 @@
         g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_NET,
                "Failed to initiate the asyncns library");
         /* FIXME: Signal error */
+        g_free (srv);
+        g_free (domain);
+        g_free (service);
+        g_free (protocol);
         return;
     }