From: Michael Poole Date: Tue, 8 Jul 2008 01:56:35 +0000 (-0400) Subject: Avoid crash when logging a HelpServ request with no request log file. X-Git-Tag: v1.4.0-rc3~6 X-Git-Url: http://git.pk910.de/?p=srvx.git;a=commitdiff_plain;h=556cf3997d34aa5efff2224811cd3ca4a8b1c17b Avoid crash when logging a HelpServ request with no request log file. src/mod-helpserv.c (helpserv_log_request): Check reqlog_f before using it. --- diff --git a/src/mod-helpserv.c b/src/mod-helpserv.c index e360db9..dfb95b6 100644 --- a/src/mod-helpserv.c +++ b/src/mod-helpserv.c @@ -702,7 +702,7 @@ static void helpserv_log_request(struct helpserv_request *req, const char *reaso assert(req != NULL); assert(reason != NULL); - if (!(ctx = saxdb_open_context(reqlog_f))) + if (!reqlog_f || !(ctx = saxdb_open_context(reqlog_f))) return; sprintf(key, "%s-%lu-%lu", req->hs->helpserv->nick, (unsigned long)req->opened, req->id); if ((res = setjmp(*saxdb_jmp_buf(ctx))) != 0) {