Merge pull request #2024 from signalwire/coverity_06042023_mod_amqp

[mod_amqp] Coverity CID 1468426 (Resource leak)
This commit is contained in:
Andrey Volk 2023-04-07 00:03:54 +03:00 committed by GitHub
commit 1acab416ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -203,7 +203,11 @@ switch_status_t mod_amqp_connection_create(mod_amqp_connection_t **conn, switch_
amqp_boolean_t ssl_verify_peer = 1; amqp_boolean_t ssl_verify_peer = 1;
if (zstr(name)) { if (zstr(name)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Connection missing name attribute\n%s\n", switch_xml_toxml(cfg, 1)); char *str_tmp = switch_xml_toxml(cfg, 1);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Connection missing name attribute\n%s\n", str_tmp);
switch_safe_free(str_tmp);
return SWITCH_STATUS_GENERR; return SWITCH_STATUS_GENERR;
} }
@ -260,6 +264,7 @@ switch_status_t mod_amqp_connection_create(mod_amqp_connection_t **conn, switch_
new_con->ssl_verify_peer = ssl_verify_peer; new_con->ssl_verify_peer = ssl_verify_peer;
*conn = new_con; *conn = new_con;
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }