From 3236fe285cc8e4695ef679f0aff6bacd957ef753 Mon Sep 17 00:00:00 2001 From: Ilia Maslakov Date: Tue, 14 Apr 2009 20:41:41 +0000 Subject: [PATCH] fix: segfault in 'edit_save_confirm_cmd', g_free non allocated memory --- edit/editcmd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/edit/editcmd.c b/edit/editcmd.c index aba00dcb0..d93a9fe34 100644 --- a/edit/editcmd.c +++ b/edit/editcmd.c @@ -776,16 +776,16 @@ int edit_load_macro_cmd (WEdit * edit, struct macro macro[], int *n, int k) /* returns 1 on success */ int edit_save_confirm_cmd (WEdit * edit) { - gchar *f; - + gchar *f = NULL; + if (edit_confirm_save) { f = g_strconcat (_(" Confirm save file? : "), edit->filename, " ", NULL); if (edit_query_dialog2 (_(" Save file "), f, _("&Save"), _("&Cancel"))){ g_free(f); return 0; } + g_free(f); } - g_free(f); return edit_save_cmd (edit); }