]> git.pond.sub.org Git - empserver/blobdiff - src/lib/common/cargo.c
Zap next uid in clink_rem(), check it in clink_add()
[empserver] / src / lib / common / cargo.c
index cf8a6282c09e3224d6ca00fd7c74e6178a6e23c3..0dc371278365835aa9aa50bc0392efab21b7fa38 100644 (file)
@@ -144,6 +144,7 @@ clink_add(struct clink *cl, int type, int uid)
        return;
     if (CANT_HAPPEN(*head >= nclink[type]))
        *head = -1;
+    CANT_HAPPEN(clink[type][uid].next >= 0);
     clink[type][uid].next = *head;
     *head = uid;
 }
@@ -171,6 +172,7 @@ clink_rem(struct clink *cl, int type, int uid)
     }
 
     *p = linkv[uid].next;
+    linkv[uid].next = -1;
 }
 
 /*