8000 RRD files creation async : memory leak · Issue #661 · collectd/collectd · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
RRD files creation async : memory leak #661
Closed
@ymettier

Description

@ymettier

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA genuine bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0