From: André Malo Date: Fri, 2 Jan 2004 23:35:59 +0000 (+0000) Subject: prevent module from segfaulting when not configured. X-Git-Tag: pre_ajp_proxy~894 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ca1c2f06eab03e8bdb7283c4f551d96b6cdecfe3;p=apache prevent module from segfaulting when not configured. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102145 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/loggers/mod_log_forensic.c b/modules/loggers/mod_log_forensic.c index 23aadf0d74..16f17e90d5 100644 --- a/modules/loggers/mod_log_forensic.c +++ b/modules/loggers/mod_log_forensic.c @@ -222,6 +222,10 @@ static int log_before(request_rec *r) int n; apr_status_t rv; + if (!cfg->fd) { + return DECLINED; + } + if (!(id = apr_table_get(r->subprocess_env, "UNIQUE_ID"))) { /* we make the assumption that we can't go through all the PIDs in under 1 second */ @@ -270,6 +274,10 @@ static int log_after(request_rec *r) int l,n; apr_status_t rv; + if (!cfg->fd) { + return DECLINED; + } + s = apr_pstrcat(r->pool, "-", id, "\n", NULL); l = n = strlen(s); rv = apr_file_write(cfg->fd, s, &n);