From badb827712f14a811483ed542b2c2cf09e650cce Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 5 Jul 2009 07:14:24 +0200 Subject: [PATCH] log: fix double free() bug during shutdown Don't free an internal configuration value in log_init(). Call config_get_path() instead of manually calling parsePath(). --- NEWS | 1 + src/log.c | 8 ++------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index b0518128a..8c3d17862 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ ver 0.15.1 (2009/??/??) * commands: - don't resume playback when stopping during pause * database: fixed NULL pointer dereference after charset change +* log: fix double free() bug during shutdown ver 0.15 (2009/06/23) diff --git a/src/log.c b/src/log.c index b7c6b9bb0..94691ab64 100644 --- a/src/log.c +++ b/src/log.c @@ -259,12 +259,8 @@ void log_init(bool verbose, bool use_stdout) log_init_syslog(); #endif } else { - char *path = parsePath(param->value); - g_free(param->value); - - if (path == NULL) - g_error("error parsing \"%s\" at line %i\n", - CONF_LOG_FILE, param->line); + const char *path = config_get_path(CONF_LOG_FILE); + assert(path != NULL); log_init_file(path, param->line); }