[Core] Fix possible leak of the subclass variable in CUSTOM_HASH'es switch_event_reserve_subclass_detailed().

This commit is contained in:
Andrey Volk committed 2020-02-16 00:29:38 +04:00
1 parent d32e7f1973
commit 8dd27183f8
3 files changed
+18 -1

No files matched your search

+7 -1
View File
@@ -503,7 +503,13 @@ SWITCH_DECLARE(switch_status_t) switch_event_reserve_subclass_detailed(const cha
subclass->owner = DUP(owner);
subclass->name = DUP(subclass_name);
switch_core_hash_insert(CUSTOM_HASH, subclass->name, subclass);
status = switch_core_hash_insert(CUSTOM_HASH, subclass->name, subclass);
if (status != SWITCH_STATUS_SUCCESS) {
free(subclass->owner);
free(subclass->name);
free(subclass);
}
end: