Skip to content

Commit c12757b

Browse files
committed
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 <[email protected]>
1 parent 37f568d commit c12757b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

viewer/svutil.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ void SVSync::StartProcess(const char* executable, const char* args) {
118118
}
119119
argv[argc] = NULL;
120120
execvp(executable, argv);
121+
free(argv[0]);
122+
free(argv[1]);
123+
delete[] argv;
121124
}
122125
#endif
123126
}

0 commit comments

Comments
 (0)