diff --git a/src/inotify.c b/src/inotify.c index c0a6fdb..603ce9d 100644 --- a/src/inotify.c +++ b/src/inotify.c @@ -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); } }