mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 13:12:03 +00:00
[Core] Fix switch_event_base_add_header leaking memory when headers are with indexes. Add a unit-test.
* [Unit-tests] Add a test provoking switch_event_add_header to memory leak. * [Core] Fix switch_event_base_add_header leaking memory when headers are with indexes.
This commit is contained in:
@@ -1062,11 +1062,14 @@ static switch_status_t switch_event_base_add_header(switch_event_t *event, switc
|
||||
exists = 1;
|
||||
}
|
||||
|
||||
FREE(data);
|
||||
goto redraw;
|
||||
}
|
||||
} else if (tmp_header) {
|
||||
free_header(&tmp_header);
|
||||
}
|
||||
|
||||
FREE(data);
|
||||
goto end;
|
||||
} else {
|
||||
if ((stack & SWITCH_STACK_PUSH) || (stack & SWITCH_STACK_UNSHIFT)) {
|
||||
|
||||
Reference in New Issue
Block a user