Commit e1abeeee authored by Simon Kelley's avatar Simon Kelley

Fix memory leak in inotify code.

parent 40205a05
...@@ -54,7 +54,10 @@ static char *my_readlink(char *path) ...@@ -54,7 +54,10 @@ static char *my_readlink(char *path)
{ {
/* Not link or doesn't exist. */ /* Not link or doesn't exist. */
if (errno == EINVAL || errno == ENOENT) if (errno == EINVAL || errno == ENOENT)
return NULL; {
free(buf);
return NULL;
}
else else
die(_("cannot access path %s: %s"), path, EC_MISC); 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 ...@@ -200,6 +203,8 @@ void set_dynamic_inotify(int flag, int total_size, struct crec **rhash, int revh
free(path); free(path);
} }
} }
closedir(dir_stream);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment