aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-08-14 11:51:35 +0200
committerMax Kellermann <max@duempel.org>2009-08-14 11:51:35 +0200
commite44f31391234607ce0e95d69903142e71d61c813 (patch)
treeda21348b8bdabd752aaeba39057aa0490a36aecf
parentf4b39bc263b46685742ad120ac9a02d4ba022532 (diff)
downloadmpd-e44f31391234607ce0e95d69903142e71d61c813.tar.gz
mpd-e44f31391234607ce0e95d69903142e71d61c813.tar.xz
mpd-e44f31391234607ce0e95d69903142e71d61c813.zip
update: free empty path string (memleak)
When you pass an empty string to directory_update_init(), it was not freed by update_task().
-rw-r--r--NEWS1
-rw-r--r--src/update.c3
2 files changed, 3 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 374c58d80..d312b6d97 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,7 @@ ver 0.15.2 (2009/??/??)
* decoders:
- mad: skip ID3 frames when libid3tag is disabled
- flac: parse all replaygain tags
+* update: free empty path string (memleak)
ver 0.15.1 (2009/07/15)
diff --git a/src/update.c b/src/update.c
index 1088f5338..9a2a2ceb9 100644
--- a/src/update.c
+++ b/src/update.c
@@ -767,7 +767,6 @@ static void * update_task(void *_path)
{
if (_path != NULL && !isRootDirectory(_path)) {
updatePath((char *)_path);
- g_free(_path);
} else {
struct directory *directory = db_get_root();
struct stat st;
@@ -776,6 +775,8 @@ static void * update_task(void *_path)
updateDirectory(directory, &st);
}
+ g_free(_path);
+
if (modified || !db_exists())
db_save();