Fix memory leak in inotify code.

This commit is contained in:
Simon Kelley
2016-03-16 17:22:27 +00:00
parent 40205a053e
commit e1abeeeec2

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);
}
}