diff options
author | Yunlian Jiang <yunlian@google.com> | 2017-01-31 16:17:50 -0800 |
---|---|---|
committer | Joe Onorato <joeo@google.com> | 2017-04-20 10:28:00 -0700 |
commit | 89547ce0178d5b5b66badc5a422cdbecc9ddac34 (patch) | |
tree | 19c4d7620dcdf797018dd45b9c836c750a0b7a9c /tools/incident_report | |
parent | 88ac6d9605083cb08be965fb13db26439b70a2f0 (diff) |
fix some memory leaks.
This fixes some warnings like
warning: Potential leak of memory pointed to by 'target'
[clang-analyzer-cplusplus.NewDeleteLeaks]
Bug: None
Test: The warnings are gone.
Change-Id: I3708671bbc9965133439664b766df3236d1b01bf
Diffstat (limited to 'tools/incident_report')
-rw-r--r-- | tools/incident_report/main.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/incident_report/main.cpp b/tools/incident_report/main.cpp index 884b8e49d08d..1d8809f6f603 100644 --- a/tools/incident_report/main.cpp +++ b/tools/incident_report/main.cpp @@ -355,6 +355,7 @@ adb_incident_workaround(const char* adbSerial, const vector<string>& sections) args[argpos++] = NULL; execvp(args[0], (char*const*)args); fprintf(stderr, "execvp failed: %s\n", strerror(errno)); + free(args); return 1; } else { // parent @@ -400,6 +401,7 @@ adb_incident_workaround(const char* adbSerial, const vector<string>& sections) } } + free(buffer); return 0; } |