From 9d9eea8451853dc39e6c5c00d60d41096ab00aec Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 5 Mar 2012 20:46:00 +0100 Subject: [PATCH] Fix some mem leaks. --- database-plain.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/database-plain.c b/database-plain.c index b603bfb..331f64f 100644 --- a/database-plain.c +++ b/database-plain.c @@ -503,8 +503,14 @@ cb_zathura_db_watch_file(GFileMonitor* UNUSED(monitor), GFile* file, GFile* UNUS zathura_plaindatabase_private_t* priv = ZATHURA_PLAINDATABASE_GET_PRIVATE(database); if (priv->bookmark_path && strcmp(priv->bookmark_path, path) == 0) { + if (priv->bookmarks != NULL) { + g_key_file_free(priv->bookmarks); + } priv->bookmarks = zathura_db_read_key_file_from_file(priv->bookmark_path); } else if (priv->history_path && strcmp(priv->history_path, path) == 0) { + if (priv->history != NULL) { + g_key_file_free(priv->history); + } priv->history = zathura_db_read_key_file_from_file(priv->history_path); } }