From 8a61898a771dc538b98fe1c471111d800515c19c Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Wed, 22 Aug 2001 20:43:30 +0000 Subject: [PATCH] v2 of sterlings segv fix always initialize the extension_info hash rather than checking that it is != NULL PR: Obtained from: Submitted by: John Sterling Reviewed by: dougm git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90510 13f79535-47bb-0310-9956-ffa450edef68 --- modules/http/mod_mime.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/http/mod_mime.c b/modules/http/mod_mime.c index 29ae4be429..45ff442542 100644 --- a/modules/http/mod_mime.c +++ b/modules/http/mod_mime.c @@ -149,7 +149,7 @@ static void *create_mime_dir_config(apr_pool_t *p, char *dummy) mime_dir_config *new = (mime_dir_config *) apr_palloc(p, sizeof(mime_dir_config)); - new->extension_mappings = NULL; + new->extension_mappings = apr_hash_make(p); new->charsets_remove = NULL; new->encodings_remove = NULL; @@ -827,10 +827,8 @@ static int find_ct(request_rec *r) ap_str_tolower(ext); #endif - if (conf->extension_mappings != NULL) { - exinfo = (extension_info*)apr_hash_get(conf->extension_mappings, - ext, APR_HASH_KEY_STRING); - } + exinfo = (extension_info*)apr_hash_get(conf->extension_mappings, + ext, APR_HASH_KEY_STRING); if (exinfo == NULL) { if ((type = apr_hash_get(mime_type_extensions, ext, -- 2.50.1