Skip to content

Commit d51326e

Browse files
committed
log: Follow up to r1908388: ap_server_conf might be NULL.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908390 13f79535-47bb-0310-9956-ffa450edef68
1 parent 4be3a3b commit d51326e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

server/log.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -1100,7 +1100,9 @@ static void log_error_core(const char *file, int line, int module_index,
11001100
}
11011101

11021102
/* Use the main ErrorLogFormat if any */
1103-
sconf = ap_get_core_module_config(ap_server_conf->module_config);
1103+
if (ap_server_conf) {
1104+
sconf = ap_get_core_module_config(ap_server_conf->module_config);
1105+
}
11041106
}
11051107
else {
11061108
int configured_level = r ? ap_get_request_module_loglevel(r, module_index) :
@@ -1148,7 +1150,7 @@ static void log_error_core(const char *file, int line, int module_index,
11481150
}
11491151
}
11501152
}
1151-
else {
1153+
else if (ap_server_conf) {
11521154
/* Use the main ErrorLogFormat if any */
11531155
sconf = ap_get_core_module_config(ap_server_conf->module_config);
11541156
}
@@ -1222,7 +1224,7 @@ static void log_error_core(const char *file, int line, int module_index,
12221224
info.file = file;
12231225
info.line = line;
12241226
info.status = status;
1225-
log_format = sconf->error_log_format;
1227+
log_format = sconf ? sconf->error_log_format : NULL;
12261228
done = 1;
12271229
}
12281230

0 commit comments

Comments
 (0)