mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-29 13:43:07 +00:00
[Core] Fix false-positive memory leak in switch_core_set_variable() detected by scan-build
This commit is contained in:
parent
8201f54a2c
commit
36ac71f621
@ -446,7 +446,8 @@ SWITCH_DECLARE(void) switch_core_set_variable(const char *varname, const char *v
|
|||||||
if (value) {
|
if (value) {
|
||||||
char *v = strdup(value);
|
char *v = strdup(value);
|
||||||
switch_string_var_check(v, SWITCH_TRUE);
|
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 {
|
} else {
|
||||||
switch_event_del_header(runtime.global_vars, varname);
|
switch_event_del_header(runtime.global_vars, varname);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user