Fix two leaks seen when using TLS connections
authorDan Winship <danw@gnome.org>
Mon, 4 Apr 2011 15:10:50 +0000 (11:10 -0400)
committerDan Winship <danw@gnome.org>
Thu, 7 Apr 2011 12:32:06 +0000 (08:32 -0400)
g_tls_certificate_list_new_from_file() was leaking the file contents,
and GSource was leaking the GSourcePrivate structure that got
created when using child sources.

gio/gtlscertificate.c
glib/gmain.c

index 84a0c4e..134f7a1 100644 (file)
@@ -421,6 +421,7 @@ g_tls_certificate_list_new_from_file (const gchar  *file,
       list = g_list_prepend (list, cert);
     }
 
+  g_free (contents);
   return g_list_reverse (list);
 }
 
index d4f393e..718c36c 100644 (file)
@@ -1700,6 +1700,13 @@ g_source_unref_internal (GSource      *source,
 
       g_slist_free (source->poll_fds);
       source->poll_fds = NULL;
+
+      if (source->priv)
+       {
+         g_slice_free (GSourcePrivate, source->priv);
+         source->priv = NULL;
+       }
+
       g_free (source);
     }