summaryrefslogtreecommitdiff
path: root/tools/msm_execute_helper.c
diff options
context:
space:
mode:
authorrbuj <[email protected]>2019-04-28 18:59:01 +0200
committerraveit65 <[email protected]>2019-09-12 16:17:44 +0200
commit819b1861ebec1d492029a5e50db2ff79b057c14a (patch)
treee85e0b28fa9b870b450650e942aaf2ee288be498 /tools/msm_execute_helper.c
parentbe2654f07768d47c3ac6436210b7a8a66180b5f2 (diff)
downloadmate-system-monitor-819b1861ebec1d492029a5e50db2ff79b057c14a.tar.bz2
mate-system-monitor-819b1861ebec1d492029a5e50db2ff79b057c14a.tar.xz
msm_execute_helper: fix memory leak
Diffstat (limited to 'tools/msm_execute_helper.c')
-rw-r--r--tools/msm_execute_helper.c6
1 files 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;
}