]> jfr.im git - irc/quakenet/newserv.git/commitdiff
Fix crash in th_delete().
authorGunnar Beutner <redacted>
Mon, 17 Jun 2013 12:20:51 +0000 (14:20 +0200)
committerGunnar Beutner <redacted>
Mon, 17 Jun 2013 12:20:51 +0000 (14:20 +0200)
--HG--
branch : shroudtrusts

trusts/trusts_db.c

index 0f9c286122f68ed1651295bf22f36ef8c8389577..1d7f9154adb1099f0736e225766ee2ee5b35c80b 100644 (file)
@@ -373,6 +373,15 @@ void th_delete(trusthost *th) {
     }
   }
 
+  if(th->parent) {
+    for(pnext=&(th->parent->children);*pnext;pnext=&((*pnext)->nextbychild)) {
+      if(*pnext == th) {
+        *pnext = th->nextbychild;
+        break;
+      }
+    }
+  }
+
   for(np=th->users;np;np=nextbytrust(np))
     settrusthost(np, NULL);