X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fdaemon%2Fcollectd.c;h=58325b95be73973b5cd5c596466255d3a325f6a5;hb=d6f0273b2ebae6995d69c7701838825b96e4f424;hp=cffb9a5fbb40a3567729deb544d5777832249c34;hpb=e739c81228d4b68531f6a64974192b1e1b0adf47;p=collectd.git diff --git a/src/daemon/collectd.c b/src/daemon/collectd.c index cffb9a5f..58325b95 100644 --- a/src/daemon/collectd.c +++ b/src/daemon/collectd.c @@ -32,7 +32,6 @@ #include "configfile.h" #include -#include #include #include @@ -197,8 +196,10 @@ static int change_basedir (const char *orig_dir) while ((dirlen > 0) && (dir[dirlen - 1] == '/')) dir[--dirlen] = '\0'; - if (dirlen <= 0) + if (dirlen <= 0) { + free (dir); return (-1); + } status = chdir (dir); if (status == 0)