From 9fb8177ca5afef7e6becf897f04a42de8dd7db5b Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Tue, 15 May 2018 18:03:00 -0700 Subject: Fix a 'memory leak' Realistically, this memory will be reclaimed by the OS when we return here. Regardless, we do a similar cleanup above if an exec() function fails, and having the free here makes our tooling slightly happier. Complained about by the static analyzer Bug: None Test: Ran the analyzer. It no longer complains about this leak. Change-Id: Ia7107c585cc38fef8bd7c59d85ff896b04e93658 --- tools/incident_report/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/incident_report/main.cpp b/tools/incident_report/main.cpp index 1d8809f6f603..4b67a3e983ac 100644 --- a/tools/incident_report/main.cpp +++ b/tools/incident_report/main.cpp @@ -529,6 +529,7 @@ main(int argc, char** argv) args[argpos++] = NULL; execvp(args[0], (char*const*)args); fprintf(stderr, "execvp failed: %s\n", strerror(errno)); + free(args); return 0; } else { // parent -- cgit v1.2.3-59-g8ed1b