[Core] Fix false-positive memory leak in switch_core_set_variable() detected by scan-build

This commit is contained in:
Andrey Volk 2021-04-06 02:23:44 +03:00
parent 8201f54a2c
commit 36ac71f621
1 changed files with 2 additions and 1 deletions

View File

@ -446,7 +446,8 @@ SWITCH_DECLARE(void) switch_core_set_variable(const char *varname, const char *v
if (value) {
char *v = strdup(value);
switch_string_var_check(v, SWITCH_TRUE);
switch_event_add_header_string(runtime.global_vars, SWITCH_STACK_BOTTOM | SWITCH_STACK_NODUP, varname, v);
switch_event_add_header_string(runtime.global_vars, SWITCH_STACK_BOTTOM, varname, v);
free(v);
} else {
switch_event_del_header(runtime.global_vars, varname);
}