aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-09 19:20:54 +0200
committerMax Kellermann <max@duempel.org>2008-10-09 19:20:54 +0200
commit478d0ba7bbbdc3efe6021f40e1fef07ed70a4050 (patch)
tree163e38a9d3635a16de029ec883d53e0238f60d93 /src
parent4beba26c615ae88df81a9cb848c971594848fee4 (diff)
downloadmpd-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.
Diffstat (limited to '')
-rw-r--r--src/update.c5
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;