Skip to content

Commit

Permalink
viewer/svutil: Fix memory leak
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
stweil committed Oct 24, 2016
1 parent 37f568d commit c12757b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions viewer/svutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit c12757b

Please sign in to comment.