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:
@@ -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;
|
||||||
|
Reference in New Issue
Block a user