From 5fbecd9925bd4bfb4751b722577605779e1d7dd7 Mon Sep 17 00:00:00 2001
From: Ove Kaaven <ovek@arcticnet.no>
Date: Fri, 7 May 1999 10:20:14 +0000
Subject: [PATCH 1/1] Took care of those missing frees from failure conditions
 in wxExecute.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2355 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 src/unix/utilsunx.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/unix/utilsunx.cpp b/src/unix/utilsunx.cpp
index 5ce6dc6c11..bb8b4b33e9 100644
--- a/src/unix/utilsunx.cpp
+++ b/src/unix/utilsunx.cpp
@@ -257,6 +257,11 @@ long wxExecute( wxChar **argv, bool sync, wxProcess *process )
     if (pipe(end_proc_detect) == -1)
     {
         wxLogSysError( _("Pipe creation failed") );
+#if wxUSE_UNICODE
+	mb_argc = 0;
+	while (mb_argv[mb_argc])
+	  free(mb_argv[mb_argc++]);
+#endif
         return 0;
     }
 
@@ -269,6 +274,11 @@ long wxExecute( wxChar **argv, bool sync, wxProcess *process )
     if (pid == -1)
     {
         wxLogSysError( _("Fork failed") );
+#if wxUSE_UNICODE
+	mb_argc = 0;
+	while (mb_argv[mb_argc])
+	  free(mb_argv[mb_argc++]);
+#endif
         return 0;
     }
     else if (pid == 0)
-- 
2.47.2