[almanah] storage: Ensure memory liberation in error case



commit f4567f4b328aba36252a532be25c05b2232e5313
Author: Álvaro Peña <alvaropg gmail com>
Date:   Fri Dec 5 19:22:32 2014 +0100

    storage: Ensure memory liberation in error case

 src/storage-manager.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/storage-manager.c b/src/storage-manager.c
index 228a0c1..439f5ac 100644
--- a/src/storage-manager.c
+++ b/src/storage-manager.c
@@ -1058,14 +1058,14 @@ almanah_storage_manager_entry_get_tags (AlmanahStorageManager *self, AlmanahEntr
        sqlite3_bind_int (statement, 3, g_date_get_day (&date));
 
        while ((result = sqlite3_step (statement)) == SQLITE_ROW) {
-               tags = g_list_append (tags, g_strdup (sqlite3_column_text (statement, 0)));
+               tags = g_list_append (tags, g_strdup ((const gchar*) sqlite3_column_text (statement, 0)));
        }
 
        sqlite3_finalize (statement);
 
        if (result != SQLITE_DONE) {
                g_debug ("Error querying for tags from database: %s", sqlite3_errmsg 
(self->priv->connection));
-               g_free (tags);
+               g_list_free_full (tags, (GDestroyNotify) g_free);
                tags = NULL;
        }
 


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