diff --git a/src/switch_core.c b/src/switch_core.c index b25c9e2618..4f5d33d4d0 100644 --- a/src/switch_core.c +++ b/src/switch_core.c @@ -581,12 +581,14 @@ SWITCH_DECLARE(switch_hash_index_t *) switch_core_mime_index(void) SWITCH_DECLARE(switch_status_t) switch_core_mime_add_type(const char *type, const char *ext) { - const char *check = (const char *) switch_core_hash_find(runtime.mime_types, ext); + const char *check; switch_status_t status = SWITCH_STATUS_FALSE; switch_assert(type); switch_assert(ext); + check = (const char *) switch_core_hash_find(runtime.mime_types, ext); + if (!check) { char *ptype = switch_core_permanent_strdup(type); char *ext_list = strdup(ext);