update: fix memory leak in directory_update_init()

When the update queue is full, directory_update_init() did not free
the path argument.
This commit is contained in:
Max Kellermann 2008-10-09 19:20:54 +02:00
parent 4beba26c61
commit 478d0ba7bb
1 changed files with 4 additions and 1 deletions

View File

@ -439,8 +439,11 @@ directory_update_init(char *path)
if (!path)
return 0;
if (update_paths_nr == ARRAY_SIZE(update_paths))
if (update_paths_nr == ARRAY_SIZE(update_paths)) {
free(path);
return 0;
}
assert(update_paths_nr < ARRAY_SIZE(update_paths));
update_paths[update_paths_nr++] = path;
next_task_id = update_task_id + update_paths_nr;