]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_commands] Fix leak of a timer object in timer_test
authorAndrey Volk <andywolk@gmail.com>
Fri, 30 Apr 2021 12:38:41 +0000 (15:38 +0300)
committerAndrey Volk <andywolk@gmail.com>
Sat, 23 Oct 2021 19:00:46 +0000 (22:00 +0300)
src/mod/applications/mod_commands/mod_commands.c

index 8c185bcb12f7da4a09fccee2e22f5e26f0191245..955f80ae33c203656acc68c155346a739134f272 100644 (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);