[gthumb] fixed possible use of uninitialized variables



commit 865fcbea72eb5fce90399f6cff2ce0a72a5556e9
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sun Nov 3 08:06:15 2019 +0100

    fixed possible use of uninitialized variables

 extensions/contact_sheet/dlg-contact-sheet.c | 2 ++
 gthumb/dlg-location.c                        | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/extensions/contact_sheet/dlg-contact-sheet.c b/extensions/contact_sheet/dlg-contact-sheet.c
index b830a166..c284c9e6 100644
--- a/extensions/contact_sheet/dlg-contact-sheet.c
+++ b/extensions/contact_sheet/dlg-contact-sheet.c
@@ -180,6 +180,7 @@ ok_clicked_cb (GtkWidget  *widget,
        g_settings_set_string (data->settings, PREF_CONTACT_SHEET_TEMPLATE, template);
 
        mime_type = NULL;
+       file_extension = NULL;
        if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (GET_WIDGET ("filetype_combobox")), &iter)) {
                gtk_tree_model_get (GTK_TREE_MODEL (GET_WIDGET ("filetype_liststore")),
                                    &iter,
@@ -206,6 +207,7 @@ ok_clicked_cb (GtkWidget  *widget,
        columns = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (GET_WIDGET ("cols_spinbutton")));
        g_settings_set_int (data->settings, PREF_CONTACT_SHEET_COLUMNS, columns);
 
+       sort_type = NULL;
        if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (GET_WIDGET ("sort_combobox")), &iter)) {
                gtk_tree_model_get (GTK_TREE_MODEL (GET_WIDGET ("sort_liststore")),
                                    &iter,
diff --git a/gthumb/dlg-location.c b/gthumb/dlg-location.c
index 23491db8..d2cc87d6 100644
--- a/gthumb/dlg-location.c
+++ b/gthumb/dlg-location.c
@@ -107,11 +107,11 @@ completion_job_new_for_uri (DialogData *data,
        job->data = dialog_data_ref (data);
        job->uri = g_strdup (uri);
        job->source = gth_main_get_file_source_for_uri (job->uri);
+       job->folder = NULL;
        if (job->source == NULL) {
                completion_job_unref (job);
                job = NULL;
        }
-       job->folder = NULL;
 
        return job;
 }


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