X-Git-Url: https://git.octo.it/?a=blobdiff_plain;ds=sidebyside;f=src%2Ffilecount.c;h=7c96a48f4b9705a12878a2ab87dcb0d62a9dc8ba;hb=1ebf2f31;hp=47caf93f264af693e0e011634abbf62345b62908;hpb=add25ce6f3129cb7138e96e5f55d11de1e5cf6de;p=collectd.git diff --git a/src/filecount.c b/src/filecount.c index 47caf93f..7c96a48f 100644 --- a/src/filecount.c +++ b/src/filecount.c @@ -344,7 +344,7 @@ static int fc_config_add_dir (oconfig_item_t *ci) } /* Initialize `dir' */ - dir = (fc_directory_conf_t *) malloc (sizeof (*dir)); + dir = malloc (sizeof (*dir)); if (dir == NULL) { ERROR ("filecount plugin: malloc failed."); @@ -356,6 +356,7 @@ static int fc_config_add_dir (oconfig_item_t *ci) if (dir->path == NULL) { ERROR ("filecount plugin: strdup failed."); + sfree (dir); return (-1); }