From 36f92e6974f4c14c420042d115ff3686093c2e69 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Wed, 4 Jan 2012 08:59:59 +0100 Subject: [PATCH] SafeTimer: check the IPC struct before trying to send a kill to the server in the timer. --- citadel/utils/sendcommand.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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); } -- 2.30.2