when flushing a node, check whether we have a context before dereferencing the pointe...
authorWilfried Goesgens <dothebart@citadel.org>
Thu, 19 Jan 2012 00:33:44 +0000 (01:33 +0100)
committerWilfried Goesgens <dothebart@citadel.org>
Thu, 19 Jan 2012 00:33:44 +0000 (01:33 +0100)
citadel/modules/network/serv_networkclient.c

index 63c6e65412e2165b29eb2852dd1f8ace014eb7de..647ec6ed634fee8cb1e5ef6af863253d4a14a068 100644 (file)
@@ -135,8 +135,10 @@ void DeleteNetworker(void *vptr)
        FreeStrBuf(&NW->port);
        FreeStrBuf(&NW->secret);
        FreeStrBuf(&NW->Url);
-       ((struct CitContext*)NW->IO.CitContext)->state = CON_IDLE;
-       ((struct CitContext*)NW->IO.CitContext)->kill_me = 1;
+       if (NW->IO.CitContext != NULL) {
+               ((struct CitContext*)NW->IO.CitContext)->state = CON_IDLE;
+               ((struct CitContext*)NW->IO.CitContext)->kill_me = 1;
+       }
        FreeAsyncIOContents(&NW->IO);
        free(NW);
 }