summaryrefslogtreecommitdiffstats
path: root/gtk-gui.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2012-01-02 20:13:45 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-01-02 20:13:45 -0800
commit43530d397bd8d754202d0e97d13c32c1f0685f01 (patch)
tree8c93656ed6fb4c64bdc0c012d82302acc19328e0 /gtk-gui.c
parenteac816b9d8a199375cf023a956c0959ccf3bc87b (diff)
downloadsubsurface-43530d397bd8d754202d0e97d13c32c1f0685f01.tar.gz
Correctly free the GSList in file_open
Passing a value that is known to be NULL to g_slist_free seems like the wrong approach... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'gtk-gui.c')
-rw-r--r--gtk-gui.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gtk-gui.c b/gtk-gui.c
index f17120319..ddae481b1 100644
--- a/gtk-gui.c
+++ b/gtk-gui.c
@@ -106,9 +106,9 @@ static void file_open(GtkWidget *w, gpointer data)
gtk_file_chooser_set_filter(GTK_FILE_CHOOSER(dialog), filter);
if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) {
- GSList *filenames;
+ GSList *filenames, *fn_glist;
char *filename;
- filenames = gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(dialog));
+ filenames = fn_glist = gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(dialog));
GError *error = NULL;
while(filenames != NULL) {
@@ -124,7 +124,7 @@ static void file_open(GtkWidget *w, gpointer data)
g_free(filename);
filenames = g_slist_next(filenames);
}
- g_slist_free(filenames);
+ g_slist_free(fn_glist);
report_dives(FALSE);
}
gtk_widget_destroy(dialog);