summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-01-30 18:21:50 +0100
committerraveit65 <[email protected]>2020-02-16 00:59:13 +0100
commit20b9d319f427b08b1883ca73a83e3bbbdf419974 (patch)
tree40796accab9f6c972d75d1a9cfe546551a18f440
parent2915302870759961e44ba5b58d34fafbf83086e3 (diff)
downloadmate-control-center-20b9d319f427b08b1883ca73a83e3bbbdf419974.tar.bz2
mate-control-center-20b9d319f427b08b1883ca73a83e3bbbdf419974.tar.xz
time-admin: dereference of NULL ‘db’ in function ‘CreateCityList’
-rw-r--r--capplets/time-admin/src/time-zone.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/capplets/time-admin/src/time-zone.c b/capplets/time-admin/src/time-zone.c
index db29aa67..caeb2ac6 100644
--- a/capplets/time-admin/src/time-zone.c
+++ b/capplets/time-admin/src/time-zone.c
@@ -363,11 +363,12 @@ static void
CreateCityList(TimeAdmin *ta)
{
TzDB *db;
- ta->CityListStore = gtk_list_store_new (CITY_NUM_COLS,G_TYPE_STRING,G_TYPE_STRING);
- db = tz_load_db ();
- g_ptr_array_foreach (db->locations, (GFunc) LoadCities, ta->CityListStore);
- TimeZoneDateBaseFree(db);
+ ta->CityListStore = gtk_list_store_new (CITY_NUM_COLS, G_TYPE_STRING, G_TYPE_STRING);
+ if ((db = tz_load_db ()) != NULL) {
+ g_ptr_array_foreach (db->locations, (GFunc) LoadCities, ta->CityListStore);
+ TimeZoneDateBaseFree (db);
+ }
}
static GtkWidget*