Commit e44f3139 authored by Max Kellermann's avatar Max Kellermann

update: free empty path string (memleak)

When you pass an empty string to directory_update_init(), it was not freed by update_task().
parent f4b39bc2
...@@ -5,6 +5,7 @@ ver 0.15.2 (2009/??/??) ...@@ -5,6 +5,7 @@ ver 0.15.2 (2009/??/??)
* decoders: * decoders:
- mad: skip ID3 frames when libid3tag is disabled - mad: skip ID3 frames when libid3tag is disabled
- flac: parse all replaygain tags - flac: parse all replaygain tags
* update: free empty path string (memleak)
ver 0.15.1 (2009/07/15) ver 0.15.1 (2009/07/15)
......
...@@ -767,7 +767,6 @@ static void * update_task(void *_path) ...@@ -767,7 +767,6 @@ static void * update_task(void *_path)
{ {
if (_path != NULL && !isRootDirectory(_path)) { if (_path != NULL && !isRootDirectory(_path)) {
updatePath((char *)_path); updatePath((char *)_path);
g_free(_path);
} else { } else {
struct directory *directory = db_get_root(); struct directory *directory = db_get_root();
struct stat st; struct stat st;
...@@ -776,6 +775,8 @@ static void * update_task(void *_path) ...@@ -776,6 +775,8 @@ static void * update_task(void *_path)
updateDirectory(directory, &st); updateDirectory(directory, &st);
} }
g_free(_path);
if (modified || !db_exists()) if (modified || !db_exists())
db_save(); db_save();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment