Commit 478d0ba7 authored by Max Kellermann's avatar Max Kellermann

update: fix memory leak in directory_update_init()

When the update queue is full, directory_update_init() did not free the path argument.
parent 4beba26c
...@@ -439,8 +439,11 @@ directory_update_init(char *path) ...@@ -439,8 +439,11 @@ directory_update_init(char *path)
if (!path) if (!path)
return 0; return 0;
if (update_paths_nr == ARRAY_SIZE(update_paths)) if (update_paths_nr == ARRAY_SIZE(update_paths)) {
free(path);
return 0; return 0;
}
assert(update_paths_nr < ARRAY_SIZE(update_paths)); assert(update_paths_nr < ARRAY_SIZE(update_paths));
update_paths[update_paths_nr++] = path; update_paths[update_paths_nr++] = path;
next_task_id = update_task_id + update_paths_nr; next_task_id = update_task_id + update_paths_nr;
......
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