projects
/
platform
/
upstream
/
glib.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9fdc8d9
)
Fix two leaks seen when using TLS connections
author
Dan Winship
<danw@gnome.org>
Mon, 4 Apr 2011 15:10:50 +0000
(11:10 -0400)
committer
Dan 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
patch
|
blob
|
history
glib/gmain.c
patch
|
blob
|
history
diff --git
a/gio/gtlscertificate.c
b/gio/gtlscertificate.c
index
84a0c4e
..
134f7a1
100644
(file)
--- a/
gio/gtlscertificate.c
+++ b/
gio/gtlscertificate.c
@@
-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);
}
diff --git
a/glib/gmain.c
b/glib/gmain.c
index
d4f393e
..
718c36c
100644
(file)
--- a/
glib/gmain.c
+++ b/
glib/gmain.c
@@
-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);
}