From 2767527c6782c63ccf03a2a86f245340b59d5358 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Fri, 30 Apr 2021 15:38:41 +0300 Subject: [PATCH] [mod_commands] Fix leak of a timer object in timer_test --- src/mod/applications/mod_commands/mod_commands.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mod/applications/mod_commands/mod_commands.c b/src/mod/applications/mod_commands/mod_commands.c index 8c185bcb12..955f80ae33 100644 --- a/src/mod/applications/mod_commands/mod_commands.c +++ b/src/mod/applications/mod_commands/mod_commands.c @@ -967,6 +967,10 @@ SWITCH_STANDARD_API(timer_test_function) stream->write_function(stream, "Avg: %0.3fms Total Time: %0.3fms\n", (float) ((float) (total / (x - 1)) / 1000), (float) ((float) (end - start) / 1000)); + if (switch_core_timer_destroy(&timer) != SWITCH_STATUS_SUCCESS) { + stream->write_function(stream, "Timer Destroy Error!\n"); + } + end: switch_core_destroy_memory_pool(&pool);