diff --git a/src/daemon/collectd.c b/src/daemon/collectd.c
index cffb9a5fbb40a3567729deb544d5777832249c34..58325b95be73973b5cd5c596466255d3a325f6a5 100644 (file)
--- a/src/daemon/collectd.c
+++ b/src/daemon/collectd.c
#include "configfile.h"
#include <sys/types.h>
-#include <sys/socket.h>
#include <sys/un.h>
#include <netdb.h>
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)