[epiphany] ephy-gsb-storage: Fix uninitialized warning



commit f791ffb529549bfc6ce032242fc631b715d96ee5
Author: Jan-Michael Brummer <jan brummer tabos org>
Date:   Thu May 7 11:36:46 2020 +0200

    ephy-gsb-storage: Fix uninitialized warning
    
    ../lib/safe-browsing/ephy-gsb-storage.c:1088:40: warning: ‘num_prefixes’ may be used uninitialized in 
this function [-Wmaybe-uninitialized]

 lib/safe-browsing/ephy-gsb-storage.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/lib/safe-browsing/ephy-gsb-storage.c b/lib/safe-browsing/ephy-gsb-storage.c
index e1cc912c8..662cc0678 100644
--- a/lib/safe-browsing/ephy-gsb-storage.c
+++ b/lib/safe-browsing/ephy-gsb-storage.c
@@ -919,11 +919,11 @@ ephy_gsb_storage_get_hash_prefixes_to_delete (EphyGSBStorage    *self,
   g_assert (list);
   g_assert (indices);
 
+  *num_prefixes = 0;
+
   if (!self->is_operable)
     return NULL;
 
-  *num_prefixes = 0;
-
   sql = "SELECT value FROM hash_prefix WHERE "
         "threat_type=? AND platform_type=? AND threat_entry_type=? "
         "ORDER BY value";
@@ -1060,7 +1060,7 @@ ephy_gsb_storage_delete_hash_prefixes_internal (EphyGSBStorage    *self,
   GList *prefixes = NULL;
   GList *head = NULL;
   GHashTable *set;
-  gsize num_prefixes;
+  gsize num_prefixes = 0;
 
   g_assert (EPHY_IS_GSB_STORAGE (self));
   g_assert (list);


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