Fix memory leak in inotify code.

This commit is contained in:
Simon Kelley committed 2016-03-16 18:12:35 +00:00
1 parent 40205a053e
commit e1abeeeec2
1 file changed
+6 -1
+6 -1
View File
@@ -54,7 +54,10 @@ static char *my_readlink(char *path)
{
/* Not link or doesn't exist. */
if (errno == EINVAL || errno == ENOENT)
return NULL;
{
free(buf);
return NULL;
}
else
die(_("cannot access path %s: %s"), path, EC_MISC);
}
@@ -200,6 +203,8 @@ void set_dynamic_inotify(int flag, int total_size, struct crec **rhash, int revh
free(path);
}
}
closedir(dir_stream);
}
}