From 556cf3997d34aa5efff2224811cd3ca4a8b1c17b Mon Sep 17 00:00:00 2001 From: Michael Poole Date: Mon, 7 Jul 2008 21:56:35 -0400 Subject: [PATCH] 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. --- src/mod-helpserv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) { -- 2.20.1