From 478d0ba7bbbdc3efe6021f40e1fef07ed70a4050 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 9 Oct 2008 19:20:54 +0200 Subject: update: fix memory leak in directory_update_init() When the update queue is full, directory_update_init() did not free the path argument. --- src/update.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/update.c b/src/update.c index 78bbf64b0..607959b1a 100644 --- a/src/update.c +++ b/src/update.c @@ -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; -- cgit v1.2.3