main/refer.c: Fix double free in refer_data_destructor + potential leak

Resolves: #267
(cherry picked from commit 48e6a482c2)
This commit is contained in:
Maximilian Fridrich 2023-08-21 18:28:42 +02:00 committed by Asterisk Development Team
parent e2f0538dea
commit 9cb77904e0
1 changed files with 1 additions and 1 deletions

View File

@ -109,7 +109,6 @@ static void refer_data_destructor(void *obj)
{
struct refer_data *data = obj;
ast_free(data->value);
ast_free(data);
}
static void refer_destructor(void *obj)
@ -298,6 +297,7 @@ static int refer_set_var_full(struct ast_refer *refer, const char *name, const c
if (ast_strlen_zero(value)) {
ao2_unlink(refer->vars, data);
} else {
ast_free(data->value);
data->value = ast_strdup(value);
}
}