Merge branch 'master' of ssh://git.citadel.org/appl/gitroot/citadel
authorWilfried Goesgens <dothebart@citadel.org>
Wed, 4 Jan 2012 08:00:42 +0000 (09:00 +0100)
committerWilfried Goesgens <dothebart@citadel.org>
Wed, 4 Jan 2012 08:00:42 +0000 (09:00 +0100)
citadel/utils/sendcommand.c

index e562602..c0870f6 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);
 }