From c2a1d1c7ca69003c3f8096afa69e1ceba8cfc355 Mon Sep 17 00:00:00 2001 From: cuihaikuo Date: Fri, 27 Jul 2018 16:41:48 +0800 Subject: [PATCH] Fix a bug of freeing wild pointer. --- net/server/group-mgr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/server/group-mgr.c b/net/server/group-mgr.c index 4a136d7..0259ccb 100644 --- a/net/server/group-mgr.c +++ b/net/server/group-mgr.c @@ -821,11 +821,13 @@ ccnet_group_manager_get_groups_by_user (CcnetGroupManager *mgr, get_group_paths_cb, paths, 0) < 0) { g_list_free_full (ret, g_object_unref); + ret = NULL; goto out; } if (g_strcmp0(paths->str, "") == 0) { ccnet_warning ("Failed to get groups path for user %s\n", user_name); g_list_free_full (ret, g_object_unref); + ret = NULL; goto out; } @@ -837,6 +839,7 @@ ccnet_group_manager_get_groups_by_user (CcnetGroupManager *mgr, get_user_groups_cb, &ret, 0) < 0) { g_list_free_full (ret, g_object_unref); + ret = NULL; goto out; } }