mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-06-18 14:55:58 +00:00
[mod_kazoo] Coverity CID 1395503 (Resource leak)
This commit is contained in:
parent
1464f1b1e7
commit
c36ee94b13
@ -1097,23 +1097,27 @@ static switch_status_t handle_request_fetch_reply(ei_node_t *ei_node, erlang_pid
|
|||||||
if (ei_decode_atom_safe(buf->buff, &buf->index, section_str)
|
if (ei_decode_atom_safe(buf->buff, &buf->index, section_str)
|
||||||
|| !(section = switch_xml_parse_section_string(section_str))) {
|
|| !(section = switch_xml_parse_section_string(section_str))) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Ignoring a fetch reply without a configuration section\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Ignoring a fetch reply without a configuration section\n");
|
||||||
|
|
||||||
return erlang_response_badarg(rbuf);
|
return erlang_response_badarg(rbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ei_decode_string_or_binary_limited(buf->buff, &buf->index, sizeof(uuid_str), uuid_str)
|
if (ei_decode_string_or_binary_limited(buf->buff, &buf->index, sizeof(uuid_str), uuid_str)
|
||||||
|| zstr_buf(uuid_str)) {
|
|| zstr_buf(uuid_str)) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Ignoring a fetch reply without request UUID\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Ignoring a fetch reply without request UUID\n");
|
||||||
|
|
||||||
return erlang_response_badarg(rbuf);
|
return erlang_response_badarg(rbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ei_decode_string_or_binary(buf->buff, &buf->index, &xml_str)) {
|
if (ei_decode_string_or_binary(buf->buff, &buf->index, &xml_str)) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Ignoring a fetch reply without XML : %s \n", uuid_str);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Ignoring a fetch reply without XML : %s \n", uuid_str);
|
||||||
|
|
||||||
return erlang_response_badarg(rbuf);
|
return erlang_response_badarg(rbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (zstr(xml_str)) {
|
if (zstr(xml_str)) {
|
||||||
switch_safe_free(xml_str);
|
switch_safe_free(xml_str);
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Ignoring an empty fetch reply : %s\n", uuid_str);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Ignoring an empty fetch reply : %s\n", uuid_str);
|
||||||
|
|
||||||
return erlang_response_badarg(rbuf);
|
return erlang_response_badarg(rbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1138,13 +1142,19 @@ static switch_status_t handle_request_fetch_reply(ei_node_t *ei_node, erlang_pid
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Received fetch reply %s for an unknown configuration section: %s : %s\n", uuid_str, section_str, xml_str);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Received fetch reply %s for an unknown configuration section: %s : %s\n", uuid_str, section_str, xml_str);
|
||||||
|
switch_safe_free(xml_str);
|
||||||
|
|
||||||
return erlang_response_badarg(rbuf);
|
return erlang_response_badarg(rbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result == SWITCH_STATUS_SUCCESS) {
|
if (result == SWITCH_STATUS_SUCCESS) {
|
||||||
|
switch_safe_free(xml_str);
|
||||||
|
|
||||||
return erlang_response_ok(rbuf);
|
return erlang_response_ok(rbuf);
|
||||||
} else {
|
} else {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Received fetch reply %s is unknown or has expired : %s\n", uuid_str, xml_str);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Received fetch reply %s is unknown or has expired : %s\n", uuid_str, xml_str);
|
||||||
|
switch_safe_free(xml_str);
|
||||||
|
|
||||||
return erlang_response_baduuid(rbuf);
|
return erlang_response_baduuid(rbuf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user