X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Ffilecount.c;h=7c96a48f4b9705a12878a2ab87dcb0d62a9dc8ba;hb=1ebf2f31bd2e080e6f42de640f0a3899a61501c0;hp=47caf93f264af693e0e011634abbf62345b62908;hpb=dd8429c16bc57f949abb2537e003b76ad88b6f90;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); }