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. --- protocols/bee_user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'protocols/bee_user.c') diff --git a/protocols/bee_user.c b/protocols/bee_user.c index ea1be3db..0a211c71 100644 --- a/protocols/bee_user.c +++ b/protocols/bee_user.c @@ -67,6 +67,8 @@ int bee_user_free(bee_t *bee, bee_user_t *bu) bu->ic->acc->prpl->buddy_data_free(bu); } + bee->users = g_slist_remove(bee->users, bu); + g_free(bu->handle); g_free(bu->fullname); g_free(bu->nick); @@ -74,8 +76,6 @@ int bee_user_free(bee_t *bee, bee_user_t *bu) g_free(bu->status_msg); g_free(bu); - bee->users = g_slist_remove(bee->users, bu); - return 1; } -- cgit v1.2.3