From: John Darrington Date: Sat, 27 Jun 2020 05:27:25 +0000 (+0200) Subject: PsppireDataWindow: Fix use after free error X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a64ef1615a50262bea79bd84a3f076ade3f0e779;p=pspp PsppireDataWindow: Fix use after free error --- diff --git a/src/ui/gui/psppire-data-window.c b/src/ui/gui/psppire-data-window.c index 73fb1e1bb1..6a0d4719c9 100644 --- a/src/ui/gui/psppire-data-window.c +++ b/src/ui/gui/psppire-data-window.c @@ -918,13 +918,12 @@ on_recent_files_select (GtkMenuShell *menushell, gpointer user_data) se = psppire_syntax_window_new (encoding); - free (encoding); - if (psppire_window_load (PSPPIRE_WINDOW (se), file, encoding, NULL)) gtk_widget_show (se); else gtk_widget_destroy (se); + g_free (encoding); g_free (file); }