From 1c2aff0feba8c68d3141e733b8558f4c7d79fa31 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Wed, 19 Feb 2020 19:00:10 +0400 Subject: [PATCH] [mod_hash] scan-build: Fix "Potential leak of memory pointed to by 'item'". --- src/mod/applications/mod_hash/mod_hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/applications/mod_hash/mod_hash.c b/src/mod/applications/mod_hash/mod_hash.c index 3a8371662a..6899922ab6 100644 --- a/src/mod/applications/mod_hash/mod_hash.c +++ b/src/mod/applications/mod_hash/mod_hash.c @@ -869,7 +869,7 @@ static void *SWITCH_THREAD_FUNC limit_remote_thread(switch_thread_t *thread, voi limit_hash_item_t *item; switch_thread_rwlock_wrlock(remote->rwlock); if (!(item = switch_core_hash_find(remote->index, argv[0]))) { - item = malloc(sizeof(*item)); + switch_zmalloc(item, sizeof(*item)); switch_core_hash_insert_auto_free(remote->index, argv[0], item); } item->total_usage = atoi(argv[1]);