mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-04 17:51:03 +00:00
[mod_hash] scan-build: Fix "Potential leak of memory pointed to by 'item'".
This commit is contained in:
parent
b3348c2dca
commit
1c2aff0feb
@ -869,7 +869,7 @@ static void *SWITCH_THREAD_FUNC limit_remote_thread(switch_thread_t *thread, voi
|
|||||||
limit_hash_item_t *item;
|
limit_hash_item_t *item;
|
||||||
switch_thread_rwlock_wrlock(remote->rwlock);
|
switch_thread_rwlock_wrlock(remote->rwlock);
|
||||||
if (!(item = switch_core_hash_find(remote->index, argv[0]))) {
|
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);
|
switch_core_hash_insert_auto_free(remote->index, argv[0], item);
|
||||||
}
|
}
|
||||||
item->total_usage = atoi(argv[1]);
|
item->total_usage = atoi(argv[1]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user