From 1c5ee6ada91d944fc6a0600e8f9255e45aa2b8d3 Mon Sep 17 00:00:00 2001 From: rbuj Date: Sun, 28 Apr 2019 18:59:01 +0200 Subject: msm_execute_helper: fix memory leak --- tools/msm_execute_helper.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/msm_execute_helper.c b/tools/msm_execute_helper.c index eff687a..5d568b4 100644 --- a/tools/msm_execute_helper.c +++ b/tools/msm_execute_helper.c @@ -8,10 +8,12 @@ int main(int argc, char* argv[]) gchar **argv_modified = g_new0 (gchar *, argc + 1); memcpy (argv_modified, argv, argc * sizeof (char*)); argv_modified[0] = COMMAND; + int errsv = 0; if (execvp (COMMAND, argv_modified) == -1) { - return errno; + errsv = errno; } - return 0; + g_free (argv_modified); + return errsv; } -- cgit v1.2.1