diff options
author | Max Kellermann <max@duempel.org> | 2008-10-09 19:20:54 +0200 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-10-11 19:21:51 -0700 |
commit | ab7e9dd283abdea1ec94c75b94e450ba39fa3835 (patch) | |
tree | f02108963b46eccfbe0d658f7bbce766f710cc15 | |
parent | e3ac6a123a442cf9d1f9147b122f21a1f3f1ebb2 (diff) | |
download | mpd-ab7e9dd283abdea1ec94c75b94e450ba39fa3835.tar.gz mpd-ab7e9dd283abdea1ec94c75b94e450ba39fa3835.tar.xz mpd-ab7e9dd283abdea1ec94c75b94e450ba39fa3835.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 68e030b78..b910486e0 100644 --- a/src/update.c +++ b/src/update.c @@ -419,8 +419,11 @@ unsigned 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; |