From c12757b53ebfe5862e911c0e6c6c6036783bbdd6 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Mon, 24 Oct 2016 13:25:45 +0200 Subject: [PATCH] viewer/svutil: Fix memory leak Coverity report: CID 1164728 (#1 of 1): Resource leak (RESOURCE_LEAK) 33. leaked_storage: Variable argv going out of scope leaks the storage it points to. Signed-off-by: Stefan Weil --- viewer/svutil.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/viewer/svutil.cpp b/viewer/svutil.cpp index ae47e21b..c41bf040 100644 --- a/viewer/svutil.cpp +++ b/viewer/svutil.cpp @@ -118,6 +118,9 @@ void SVSync::StartProcess(const char* executable, const char* args) { } argv[argc] = NULL; execvp(executable, argv); + free(argv[0]); + free(argv[1]); + delete[] argv; } #endif }