diff options
author | Max Kellermann <max@duempel.org> | 2008-10-09 19:20:54 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-10-09 19:20:54 +0200 |
commit | 478d0ba7bbbdc3efe6021f40e1fef07ed70a4050 (patch) | |
tree | 163e38a9d3635a16de029ec883d53e0238f60d93 | |
parent | 4beba26c615ae88df81a9cb848c971594848fee4 (diff) | |
download | mpd-478d0ba7bbbdc3efe6021f40e1fef07ed70a4050.tar.gz mpd-478d0ba7bbbdc3efe6021f40e1fef07ed70a4050.tar.xz mpd-478d0ba7bbbdc3efe6021f40e1fef07ed70a4050.zip |
update: fix memory leak in directory_update_init()
When the update queue is full, directory_update_init() did not free
the path argument.
-rw-r--r-- | src/update.c | 5 |
1 files changed, 4 insertions, 1 deletions
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; |