Skip to content

Commit

Permalink
[mod_commands] Fix leak of a timer object in timer_test
Browse files Browse the repository at this point in the history
  • Loading branch information
andywolk committed Oct 23, 2021
1 parent 3447dae commit 90b85ce
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/mod/applications/mod_commands/mod_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

1 comment on commit 90b85ce

@andywolk
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.