From e5c35162e112e97b1e3562cb2386f76160d48339 Mon Sep 17 00:00:00 2001 From: Masamichi Hosoda Date: Thu, 30 Jun 2016 22:59:15 +0900 Subject: [PATCH] Issue 4910/1: Fix memory leak in ly:spawn () This commit makes free the memory allocated by g_spawn_sync (). --- lily/general-scheme.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lily/general-scheme.cc b/lily/general-scheme.cc index 02cf2fa76b..302dbd500d 100644 --- a/lily/general-scheme.cc +++ b/lily/general-scheme.cc @@ -664,6 +664,9 @@ LY_DEFINE (ly_spawn, "ly:spawn", // Print out stdout and stderr only in debug mode debug_output (string ("\n") + standard_output + standard_error, true); + g_free (standard_error); + g_free (standard_output); + for (int i = 0; i < n; i++) free (argv[i]); delete[] argv; -- 2.39.2