update: free empty path string (memleak)

When you pass an empty string to directory_update_init(), it was not
freed by update_task().
This commit is contained in:
Max Kellermann 2009-08-14 11:51:35 +02:00
parent f4b39bc263
commit e44f313912
2 changed files with 3 additions and 1 deletions

1
NEWS
View File

@ -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)

View File

@ -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();