[epiphany/wip/google-safe-browsing: 55/57] gsb-storage: Don't fail _open_db() if pragmas fail



commit 5c69b30cfc0ab134fbe87b7299c91627620aacd6
Author: Gabriel Ivascu <gabrielivascu gnome org>
Date:   Tue Oct 3 16:19:16 2017 +0200

    gsb-storage: Don't fail _open_db() if pragmas fail
    
    The database can operate without the pragmas too.

 lib/safe-browsing/ephy-gsb-storage.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
---
diff --git a/lib/safe-browsing/ephy-gsb-storage.c b/lib/safe-browsing/ephy-gsb-storage.c
index c75ef7f..bff3b4f 100644
--- a/lib/safe-browsing/ephy-gsb-storage.c
+++ b/lib/safe-browsing/ephy-gsb-storage.c
@@ -318,17 +318,13 @@ ephy_gsb_storage_open_db (EphyGSBStorage *self)
   ephy_sqlite_connection_execute (self->db, "PRAGMA foreign_keys=ON", &error);
   if (error) {
     g_warning ("Failed to enable foreign keys pragma: %s", error->message);
-    g_error_free (error);
-    g_clear_object (&self->db);
-    return FALSE;
+    g_clear_pointer (&error, (GDestroyNotify)g_error_free);
   }
 
   ephy_sqlite_connection_execute (self->db, "PRAGMA synchronous=OFF", &error);
   if (error) {
     g_warning ("Failed to disable synchronous pragma: %s", error->message);
     g_error_free (error);
-    g_clear_object (&self->db);
-    return FALSE;
   }
 
   return TRUE;


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