From e44f31391234607ce0e95d69903142e71d61c813 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 14 Aug 2009 11:51:35 +0200 Subject: update: free empty path string (memleak) When you pass an empty string to directory_update_init(), it was not freed by update_task(). --- src/update.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') 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(); -- cgit v1.2.3