From 05816dd33396f92b7d9348a2acd18537ac18fa1e Mon Sep 17 00:00:00 2001 From: dequis Date: Sun, 22 Feb 2015 19:04:08 -0300 Subject: coverity: Fix some (harmless?) use-after-free with g_slist_remove() These were passing a pointer to a variable right after it was g_free()'d They are most likely harmless as g_slist_remove() probably just needs the pointer location, but fixing it anyway. --- ipc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ipc.c') diff --git a/ipc.c b/ipc.c index b7ab9552..4041f442 100644 --- a/ipc.c +++ b/ipc.c @@ -775,14 +775,14 @@ void ipc_master_free_one(struct bitlbee_child *c) close(c->to_fd); } + child_list = g_slist_remove(child_list, c); + g_free(c->host); g_free(c->nick); g_free(c->realname); g_free(c->password); g_free(c); - child_list = g_slist_remove(child_list, c); - /* Also, if any child has a reference to this one, remove it. */ for (l = child_list; l; l = l->next) { struct bitlbee_child *oc = l->data; -- cgit v1.2.3