[libgweather] location-entry: Fix possible uninitialized variable



commit 12a445e7f003b0a87001121dd6ff1d4ad8d784de
Author: Benjamin Berg <bberg redhat com>
Date:   Thu Feb 18 15:38:13 2021 +0100

    location-entry: Fix possible uninitialized variable
    
    The scope variable needs to be initialized to NULL so that the fallback
    correctly kicks in when a lookup by country code was not tried.
    
    Fixes: #79

 libgweather/gweather-location-entry.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/libgweather/gweather-location-entry.c b/libgweather/gweather-location-entry.c
index 15141442..5f55f77e 100644
--- a/libgweather/gweather-location-entry.c
+++ b/libgweather/gweather-location-entry.c
@@ -735,7 +735,7 @@ match_selected (GtkEntryCompletion *completion,
        char *display_name;
        GeocodeLocation *loc;
        GWeatherLocation *location;
-       GWeatherLocation *scope;
+       GWeatherLocation *scope = NULL;
        const char* country_code;
 
        gtk_tree_model_get (model, iter,


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