mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 11:58:52 +00:00
main/refer.c: Fix double free in refer_data_destructor + potential leak
Resolves: #267
(cherry picked from commit fcdffe0074
)
This commit is contained in:
committed by
Asterisk Development Team
parent
534269e3e6
commit
b2cd0583c9
@@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user