[mod_commands] Fix leak of a timer object in timer_test

This commit is contained in:
Andrey Volk 2021-04-30 15:38:41 +03:00
parent 83a02712f5
commit 2767527c67

View File

@ -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);