Merge pull request #386 from signalwire/mod_hash_leak

[mod_hash] scan-build: Fix "Potential leak of memory pointed to by 'item'".
This commit is contained in:
Andrey Volk 2020-02-19 19:56:52 +04:00 committed by GitHub
commit 895ad2f976
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View 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]);