mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 13:12:03 +00:00
FS-12038: [mod_sofia, core] Fix potential leak and race in chat_hash, add switch_core_hash_insert_auto_free().
This commit is contained in:
@@ -1424,6 +1424,16 @@ SWITCH_DECLARE(switch_status_t) switch_core_hash_init_case(_Out_ switch_hash_t *
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_hash_destroy(_Inout_ switch_hash_t **hash);
|
||||
|
||||
/*!
|
||||
\brief Insert data into a hash and set flags so the value is automatically freed on delete
|
||||
\param hash the hash to add data to
|
||||
\param key the name of the key to add the data to
|
||||
\param data the data to add
|
||||
\return SWITCH_STATUS_SUCCESS if the data is added
|
||||
\note the string key must be a constant or a dynamic string
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_hash_insert_auto_free(switch_hash_t *hash, const char *key, const void *data);
|
||||
|
||||
/*!
|
||||
\brief Insert data into a hash
|
||||
\param hash the hash to add data to
|
||||
|
||||
Reference in New Issue
Block a user