Closed
Description
Hello,
I found a memory leak when you create RRD files with rrdcached
plugin enabled with CreateFilesAsync true
LoadPlugin rrdcached
<Plugin rrdcached>
[...]
CreateFiles true
CreateFilesAsync true
[...]
</Plugin>
Description of the bug
Source file : utils_rrdcreate.c
Function srrd_create_args_create()
starts with a malloc()
call :
args = malloc (sizeof (*args));
Then, for all the life of the args
variable, if something goes wrong, srrd_create_args_destroy (args)
is called.
However, the args
variable is never freed.
Suggestion for a fix
Replace all occurrence of
srrd_create_args_destroy (args);
with
srrd_create_args_destroy (args); free(args); args = NULL;
Patch / Pull Request
I'm not writing a patch/pull request for this easy fix because there is another problem with this code, best described in #640 with Pull Request attached.
I updated my PR #640 with the fix for this bug/memory leak.