FS-5445 --resolve this was actually just missing one word from the code as seen in the similar code in the core, the same mistake was made there where the compiler is not smart enough to see the mutually exclusive logical paths this code is specific to spontaneously creating an array in a single set like set foo[12]=val which would be totally broken if that line were commented

This commit is contained in:
Anthony Minessale 2013-07-10 10:26:08 -05:00
parent de9bd1c367
commit 30d5ecf9f7
2 changed files with 4 additions and 6 deletions

View File

@ -445,7 +445,7 @@ static esl_status_t esl_event_base_add_header(esl_event_t *event, esl_stack_t st
fly++;
}
if ((header = esl_event_get_header_ptr(event, header_name))) {
if (header || (header = esl_event_get_header_ptr(event, header_name))) {
if (index_ptr) {
if (index > -1 && index <= 4000) {

View File

@ -916,11 +916,9 @@ static switch_status_t switch_event_base_add_header(switch_event_t *event, switc
if (index_ptr || (stack & SWITCH_STACK_PUSH) || (stack & SWITCH_STACK_UNSHIFT)) {
if (!(header = switch_event_get_header_ptr(event, header_name)) && index_ptr) {
/*
* Removing a possible leak. But it doesn't appear this is used anywhere, and even if it were then it wouldn't be working.
header = new_header(header_name);
*/
header = new_header(header_name);
if (switch_test_flag(event, EF_UNIQ_HEADERS)) {
switch_event_del_header(event, header_name);
}