bugfix for double free error when you stop srvx
[srvx.git] / src / mod-hostserv.c
index 291fac2dc60d61f3d73f66c9a5e13f344b13e0e4..8e1ee36e3b08cc4c122078d7e541a85721aca1cd 100644 (file)
@@ -168,7 +168,7 @@ static void hs_free_all() {
         }
         for(slfh = tlfh->secondlevel; slfh; slfh = next_slfh) {
             next_slfh = slfh->next;
-            for(manager = tlfh->managers; manager; manager = next_manager) {
+            for(manager = slfh->managers; manager; manager = next_manager) {
                 next_manager = manager->next;
                 free(manager);
             }
@@ -359,7 +359,7 @@ static void hs_activate_assignment(struct hs_user *user, struct hs_assignment *a
         assignment->active = 1;
     }
     
-    apply_fakehost(assignment->user->hi, NULL);
+    apply_fakehost(user->hi, NULL);
 }
 
 static struct hs_assignment *hs_add_assignment(struct hs_secondlevel *slfh, struct hs_user *user) {
@@ -969,9 +969,6 @@ static MODCMD_FUNC(cmd_set) {
         hs_activate_assignment(hs_user, NULL);
         return 1;
     } else {
-        if(!strchr(argv[1], '.')) {
-            
-        }
         fakehost = argv[1];
         char *slfh_name = fakehost;
         char *tlfh_name = strchr(fakehost, '.');