From: Wilfried Goesgens Date: Wed, 4 Jan 2012 07:59:59 +0000 (+0100) Subject: SafeTimer: check the IPC struct before trying to send a kill to the server in the... X-Git-Tag: v8.11~271 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=36f92e6974f4c14c420042d115ff3686093c2e69;hp=526410bf2227f1574b6760264436a22dd02ca244 SafeTimer: check the IPC struct before trying to send a kill to the server in the timer. --- diff --git a/citadel/utils/sendcommand.c b/citadel/utils/sendcommand.c index e562602af..c0870f62b 100644 --- a/citadel/utils/sendcommand.c +++ b/citadel/utils/sendcommand.c @@ -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); }