FS-8816 #resolve [switch_hashtable_insert_destructor() returns 0/-1 but switch_core_hash_insert_destructor never checks this]
This commit is contained in:
parent
79e2d4ed93
commit
eea9f03ddd
|
@ -57,9 +57,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_hash_destroy(switch_hash_t **hash)
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_core_hash_insert_destructor(switch_hash_t *hash, const char *key, const void *data, hashtable_destructor_t destructor)
|
SWITCH_DECLARE(switch_status_t) switch_core_hash_insert_destructor(switch_hash_t *hash, const char *key, const void *data, hashtable_destructor_t destructor)
|
||||||
{
|
{
|
||||||
switch_hashtable_insert_destructor(hash, strdup(key), (void *)data, HASHTABLE_FLAG_FREE_KEY | HASHTABLE_DUP_CHECK, destructor);
|
int r = 0;
|
||||||
|
|
||||||
return SWITCH_STATUS_SUCCESS;
|
r = switch_hashtable_insert_destructor(hash, strdup(key), (void *)data, HASHTABLE_FLAG_FREE_KEY | HASHTABLE_DUP_CHECK, destructor);
|
||||||
|
|
||||||
|
return r ? SWITCH_STATUS_FALSE : SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_core_hash_insert_locked(switch_hash_t *hash, const char *key, const void *data, switch_mutex_t *mutex)
|
SWITCH_DECLARE(switch_status_t) switch_core_hash_insert_locked(switch_hash_t *hash, const char *key, const void *data, switch_mutex_t *mutex)
|
||||||
|
|
Loading…
Reference in New Issue