-
Notifications
You must be signed in to change notification settings - Fork 258
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dird: Fix memory leak with configure usage string.
As the old buffer was defined as static inside the get_configure_parameter() function it means its scope is still active at the time the daemon ends and it will never be freed and as such smartalloc whines in the following way: bareos-dir: smartall.c:414-0 Orphaned buffer: bareos-dir 10016 bytes at 6e6b68 from mem_pool.c:242 The new approach is to use a static global variable and a dynamic allocate of the POOL_MEM buffer and an extra cleanup function destroy_configure_usage_string() which is called from terminate_dird(). I also renamed the original function from get_configure_parameter() to get_configure_usage_string() which describes the function a bit better.
- Loading branch information
Marco van Wieringen
committed
May 9, 2016
1 parent
6544312
commit 37b2bd8
Showing
4 changed files
with
30 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters