[epiphany/history-rewrite: 15/45] ephy_history_service_get_url_row: don't leak the url strings



commit 0c00e34c417f1e25d013a105ba44c97d2127d5d9
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Tue Jul 5 13:13:31 2011 +0300

    ephy_history_service_get_url_row: don't leak the url strings

 lib/history/ephy-history-service-urls-table.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/lib/history/ephy-history-service-urls-table.c b/lib/history/ephy-history-service-urls-table.c
index f4d7bc7..d6999bf 100644
--- a/lib/history/ephy-history-service-urls-table.c
+++ b/lib/history/ephy-history-service-urls-table.c
@@ -99,7 +99,13 @@ ephy_history_service_get_url_row (EphyHistoryService *self, const char *url_stri
 
   if (url == NULL) {
     url = ephy_history_url_new (NULL, NULL, 0, 0, 0);
+  } else {
+    if (url->url)
+      g_free (url->url);
+    if (url->title)
+      g_free (url->title);
   }
+
   url->id = ephy_sqlite_statement_get_column_as_int (statement, 0);
   url->url = g_strdup (ephy_sqlite_statement_get_column_as_string (statement, 1)),
   url->title = g_strdup (ephy_sqlite_statement_get_column_as_string (statement, 2)),



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]