]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_hash] scan-build: Fix "Potential leak of memory pointed to by 'item'". 386/head
authorAndrey Volk <andywolk@gmail.com>
Wed, 19 Feb 2020 15:00:10 +0000 (19:00 +0400)
committerAndrey Volk <andywolk@gmail.com>
Wed, 19 Feb 2020 15:37:09 +0000 (19:37 +0400)
src/mod/applications/mod_hash/mod_hash.c

index 3a8371662a1948182043975a6dc275ea0994432b..6899922ab64b79cdfdbbd35c5c63f361b70e3c3c 100644 (file)
@@ -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]);