diff options
author | Luis A. Lozano | 2017-08-22 18:30:11 -0500 |
---|---|---|
committer | Yifan Hong | 2017-08-25 13:24:05 -0500 |
commit | 56ca3bf6179a9c2efcc772ac42ba880b4fd3bb59 (patch) | |
tree | 0e530fcdfc9cad6b0a0387b22f9477e707ba77c5 | |
parent | 45e5f72a1433f385afcda5ebf28c38a4010f8fda (diff) | |
download | platform-system-libvintf-56ca3bf6179a9c2efcc772ac42ba880b4fd3bb59.tar.gz platform-system-libvintf-56ca3bf6179a9c2efcc772ac42ba880b4fd3bb59.tar.xz platform-system-libvintf-56ca3bf6179a9c2efcc772ac42ba880b4fd3bb59.zip |
Fix memory leak in string created for strtok.
Reported by static analyzer:
system/libvintf/assemble_vintf.cpp:100:18: warning: Potential leak of
memory pointed to by 'modPath' [clang-analyzer-cplusplus.NewDeleteLeaks]
Bug: 27101951
Test: verified warning is gone.
Change-Id: Iab26bc356e3df2a811ad7d34228533ea5dcd8edb
Merged-In: Iab26bc356e3df2a811ad7d34228533ea5dcd8edb
-rw-r--r-- | assemble_vintf.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/assemble_vintf.cpp b/assemble_vintf.cpp index cbfc368..d75e889 100644 --- a/assemble_vintf.cpp +++ b/assemble_vintf.cpp | |||
@@ -102,6 +102,7 @@ public: | |||
102 | ret &= parseFileForKernelConfigs(pathIter, out); | 102 | ret &= parseFileForKernelConfigs(pathIter, out); |
103 | pathIter = strtok(NULL, ":"); | 103 | pathIter = strtok(NULL, ":"); |
104 | } | 104 | } |
105 | delete[] modPath; | ||
105 | return ret; | 106 | return ret; |
106 | } | 107 | } |
107 | 108 | ||
@@ -423,4 +424,3 @@ int main(int argc, char **argv) { | |||
423 | 424 | ||
424 | return success ? 0 : 1; | 425 | return success ? 0 : 1; |
425 | } | 426 | } |
426 | |||