]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_amqp] Coverity CID 1468426 (Resource leak) 2024/head
authorJakub Karolczyk <jakub.karolczyk@signalwire.com>
Wed, 5 Apr 2023 23:43:08 +0000 (00:43 +0100)
committerJakub Karolczyk <jakub.karolczyk@signalwire.com>
Thu, 6 Apr 2023 17:31:40 +0000 (18:31 +0100)
src/mod/event_handlers/mod_amqp/mod_amqp_connection.c

index 91feec93d5c54a731c795ea3ee5aaf546fe2c7a3..73cf09a35407a2313d5b53b2169dff92c8cd8ec6 100644 (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;
 
        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;
        }
 
@@ -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;
 
        *conn = new_con;
+
        return SWITCH_STATUS_SUCCESS;
 }