From e632759ae8aa57e2591b4fdf925a827cc57af0db Mon Sep 17 00:00:00 2001 From: Clarence Date: Sun, 5 Dec 2021 17:55:51 +0800 Subject: [PATCH] [mod_amqp] Fix memory leaks on command queue name and parsing configure file --- src/mod/event_handlers/mod_amqp/mod_amqp_command.c | 2 +- src/mod/event_handlers/mod_amqp/mod_amqp_utils.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mod/event_handlers/mod_amqp/mod_amqp_command.c b/src/mod/event_handlers/mod_amqp/mod_amqp_command.c index c98c123c07..2789a6e252 100644 --- a/src/mod/event_handlers/mod_amqp/mod_amqp_command.c +++ b/src/mod/event_handlers/mod_amqp/mod_amqp_command.c @@ -274,11 +274,11 @@ static void mod_amqp_command_response(mod_amqp_command_profile_t *profile, char void * SWITCH_THREAD_FUNC mod_amqp_command_thread(switch_thread_t *thread, void *data) { + amqp_bytes_t queueName = { 0, NULL }; mod_amqp_command_profile_t *profile = (mod_amqp_command_profile_t *) data; while (profile->running) { amqp_queue_declare_ok_t *recv_queue; - amqp_bytes_t queueName = { 0, NULL }; /* Ensure we have an AMQP connection */ if (!profile->conn_active) { diff --git a/src/mod/event_handlers/mod_amqp/mod_amqp_utils.c b/src/mod/event_handlers/mod_amqp/mod_amqp_utils.c index 7ebcff6e3f..03a0f262c0 100644 --- a/src/mod/event_handlers/mod_amqp/mod_amqp_utils.c +++ b/src/mod/event_handlers/mod_amqp/mod_amqp_utils.c @@ -193,6 +193,7 @@ switch_status_t mod_amqp_do_config(switch_bool_t reload) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Unable to locate logging section for mod_amqp\n" ); } + switch_xml_free(xml); return SWITCH_STATUS_SUCCESS; } -- 2.47.2