mirror of
https://github.com/asterisk/asterisk.git
synced 2025-12-01 10:41:44 +00:00
res_sorcery_memory_cache.c: Fix memory leak
Replace the original call to ast_strdup with a call to ast_strdupa to fix the leak issue.
Resolves: #55
ASTERISK-30429
(cherry picked from commit 8abb294063)
This commit is contained in:
committed by
Asterisk Development Team
parent
0e4a9d7251
commit
2d1e5f81ee
@@ -1507,7 +1507,7 @@ static int age_cmp(void *a, void *b)
|
|||||||
*/
|
*/
|
||||||
static void *sorcery_memory_cache_open(const char *data)
|
static void *sorcery_memory_cache_open(const char *data)
|
||||||
{
|
{
|
||||||
char *options = ast_strdup(data), *option;
|
char *options = ast_strdupa(data), *option;
|
||||||
RAII_VAR(struct sorcery_memory_cache *, cache, NULL, ao2_cleanup);
|
RAII_VAR(struct sorcery_memory_cache *, cache, NULL, ao2_cleanup);
|
||||||
|
|
||||||
cache = ao2_alloc_options(sizeof(*cache), sorcery_memory_cache_destructor, AO2_ALLOC_OPT_LOCK_NOLOCK);
|
cache = ao2_alloc_options(sizeof(*cache), sorcery_memory_cache_destructor, AO2_ALLOC_OPT_LOCK_NOLOCK);
|
||||||
|
|||||||
Reference in New Issue
Block a user