summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2006-04-10 17:28:47 +0000
committerClaudio Takahasi <claudio.takahasi@openbossa.org>2006-04-10 17:28:47 +0000
commit1f98ca9b57ecd36d032449972b7b9f006ad1e06f (patch)
tree93902fb3eb844f7cc70107f78423b294ec9ed9cf /common
parent99ab0e609a4590d0027ae42d95ed1ca0b6c2e86f (diff)
Fixed discoverable timeout and timeout list data memory leak
Diffstat (limited to 'common')
-rw-r--r--common/glib-ectomy.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/common/glib-ectomy.c b/common/glib-ectomy.c
index f1d79e7f..7644fd18 100644
--- a/common/glib-ectomy.c
+++ b/common/glib-ectomy.c
@@ -133,6 +133,14 @@ guint g_io_add_watch(GIOChannel *channel, GIOCondition condition,
func, user_data, NULL);
}
+static void timeout_free(void *data, void *user_data)
+{
+ struct timeout *t = data;
+
+ if (t)
+ free (t);
+}
+
static GMainContext *g_main_context_default()
{
@@ -310,6 +318,7 @@ void g_main_loop_unref(GMainLoop *loop)
if (!loop->context)
return;
+ slist_foreach(loop->context->ltimeout, timeout_free, NULL);
slist_free(loop->context->ltimeout);
free(loop->context);
}