diff options
author | Max Kellermann <max@duempel.org> | 2009-08-15 21:18:38 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-08-15 21:18:38 +0200 |
commit | f401c1059c78358b701dbee22ca78035c6e652eb (patch) | |
tree | 5cf487eea76b70b91e6acee8f55b6ca135b45a4a /src/update.c | |
parent | e28a0e97b5d2e54684c6452d6d45f64ff1e542d9 (diff) | |
parent | 5715534b530cfed0d6650b0fb34cfcb17da4088b (diff) | |
download | mpd-f401c1059c78358b701dbee22ca78035c6e652eb.tar.gz mpd-f401c1059c78358b701dbee22ca78035c6e652eb.tar.xz mpd-f401c1059c78358b701dbee22ca78035c6e652eb.zip |
Merged release 0.15.2 from branch 'v0.15.x'
Conflicts:
NEWS
configure.ac
Diffstat (limited to '')
-rw-r--r-- | src/update.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/update.c b/src/update.c index b857b4d65..6778a5989 100644 --- a/src/update.c +++ b/src/update.c @@ -430,7 +430,7 @@ update_container_file( struct directory* directory, { char* vtrack = NULL; unsigned int tnum = 0; - const char* pathname = map_directory_child_fs(directory, name); + char* pathname = map_directory_child_fs(directory, name); struct directory* contdir = dirvec_find(&directory->children, name); // directory exists already @@ -446,8 +446,10 @@ update_container_file( struct directory* directory, modified = true; } - else + else { + g_free(pathname); return true; + } } contdir = make_subdir(directory, name); @@ -473,6 +475,8 @@ update_container_file( struct directory* directory, g_free(vtrack); } + g_free(pathname); + if (tnum == 1) { delete_directory(contdir); @@ -767,7 +771,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 +779,8 @@ static void * update_task(void *_path) updateDirectory(directory, &st); } + g_free(_path); + if (modified || !db_exists()) db_save(); |