Fix two leaks seen when using TLS connections

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.
This commit is contained in:
Dan Winship 2011-04-04 11:10:50 -04:00
parent 9fdc8d976a
commit 784619bc3a
2 changed files with 8 additions and 0 deletions

View File

@ -421,6 +421,7 @@ g_tls_certificate_list_new_from_file (const gchar *file,
list = g_list_prepend (list, cert); list = g_list_prepend (list, cert);
} }
g_free (contents);
return g_list_reverse (list); return g_list_reverse (list);
} }

View File

@ -1700,6 +1700,13 @@ g_source_unref_internal (GSource *source,
g_slist_free (source->poll_fds); g_slist_free (source->poll_fds);
source->poll_fds = NULL; source->poll_fds = NULL;
if (source->priv)
{
g_slice_free (GSourcePrivate, source->priv);
source->priv = NULL;
}
g_free (source); g_free (source);
} }