From: NurPech Date: Wed, 2 Jan 2013 03:37:58 +0000 (+0100) Subject: bugfix for segmentation fault when you would delete a Fakehostgroup with active assig... X-Git-Url: http://git.pk910.de/?p=srvx.git;a=commitdiff_plain;h=f124d91a5063d18f95556bec4bdad7e24a387650 bugfix for segmentation fault when you would delete a Fakehostgroup with active assignemnts --- diff --git a/src/mod-hostserv.c b/src/mod-hostserv.c index da02cbb..7f86d6e 100644 --- a/src/mod-hostserv.c +++ b/src/mod-hostserv.c @@ -452,8 +452,6 @@ static void hs_del_assignment(struct hs_assignment *assignment, int remove_from_ } else prev_assignment = cassignment; } - if(assignment->user->managements == NULL && assignment->user->assignments == NULL) - hs_del_user(assignment->user); if(assignment->active) { struct handle_info *hi; @@ -462,6 +460,9 @@ static void hs_del_assignment(struct hs_assignment *assignment, int remove_from_ hi->fakehost = NULL; apply_fakehost(hi, NULL); } + + if(assignment->user->managements == NULL && assignment->user->assignments == NULL) + hs_del_user(assignment->user); } free(assignment); }