SafeTimer: check the IPC struct before trying to send a kill to the server in the...
authorWilfried Goesgens <dothebart@citadel.org>
Wed, 4 Jan 2012 07:59:59 +0000 (08:59 +0100)
committerWilfried Goesgens <dothebart@citadel.org>
Wed, 4 Jan 2012 07:59:59 +0000 (08:59 +0100)
citadel/utils/sendcommand.c

index e562602af3b5bf28494e3b2cd7ea3a4e9c28d398..c0870f62bfb046c2a6fe4c160c85db90f2256d64 100644 (file)
@@ -98,8 +98,12 @@ void cleanup(int e)
 
        alarm(30);
        signal(SIGALRM, nq_cleanup);
-       serv_write(ipc, "\n", 1);
-       if (nested++ < 1)
+       if ((ipc != NULL) && 
+           (ipc->sock > 0))
+               serv_write(ipc, "\n", 1);
+       if ((nested++ < 1) &&
+           (ipc != NULL) &&
+           (ipc->sock > 0))
                CtdlIPCQuit(ipc);
        nq_cleanup(e);
 }