From 898c0602de94c9f560de664cfc54055a8154dbaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrico=20Tr=C3=B6ger?= Date: Wed, 26 Mar 2008 17:52:27 +0000 Subject: [PATCH] Fix two memory leaks and prevent showing two dialog boxes with the same error message. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2415 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- ChangeLog | 3 +++ plugins/vcdiff.c | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 104c3134..6774938c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,9 @@ Update Scintilla to version 1.76. * scintilla/include/Scintilla.iface: Add this file for plugin authors. + * plugins/vcdiff.c: + Fix two memory leaks and prevent showing two dialog boxes with the + same error message. 2008-03-26 Nick Treleaven diff --git a/plugins/vcdiff.c b/plugins/vcdiff.c index ded585e2..65be9a8c 100644 --- a/plugins/vcdiff.c +++ b/plugins/vcdiff.c @@ -357,10 +357,10 @@ static gchar *make_diff(const gchar *filename, gint cmd) { p_ui->set_statusbar(FALSE, _("No changes were made.")); } - - if (NZV(std_error)) + /* win32_spawn() returns sometimes TRUE but error is set anyway, has to be fixed */ + if (error != NULL) { - p_dialogs->show_msgbox(1, _("VCdiff command sent errors:\n%s\n."), std_error); + g_error_free(error); } } else @@ -378,6 +378,7 @@ static gchar *make_diff(const gchar *filename, gint cmd) argv[0]); } p_ui->set_statusbar(FALSE, _("An error occurred (%s)."), msg); + g_free(msg); } g_free(dir);