diff options
author | Alex Deymo <deymo@chromium.org> | 2015-06-12 12:18:56 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-06-12 23:51:58 +0000 |
commit | a50870549b0fc16b659250449fffbd3eacc57d8b (patch) | |
tree | 7086bc2fa50c97450560c6db9ef21d1d64ad0494 | |
parent | bfeeb2e85b7881ec16badb0e104c600639102ce2 (diff) |
update_engine: Fix memory leak on new ext2_filesystem code.
ext2fs_get_pathname() allocates new memory to store the pathname and we
are supposed to free it. This patch adds the missing call to
ext2fs_free_mem().
BUG=None
TEST=`FEATURES=test USE="clang asan" VERBOSE=1 GTEST_FILTER="Ext2*" emerge-link update_engine` works now and didn't work before
Change-Id: I5244e7f9721875590c3b2455d469866d28c70c09
Reviewed-on: https://chromium-review.googlesource.com/277277
Tested-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
-rw-r--r-- | payload_generator/ext2_filesystem.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/payload_generator/ext2_filesystem.cc b/payload_generator/ext2_filesystem.cc index 0467b806..9670e395 100644 --- a/payload_generator/ext2_filesystem.cc +++ b/payload_generator/ext2_filesystem.cc @@ -250,6 +250,7 @@ bool Ext2Filesystem::GetFiles(vector<File>* files) const { files->push_back(inodes[dir_ino]); used_inodes.insert(dir_ino); } + ext2fs_free_mem(&dir_name); error = ext2fs_dir_iterate2( filsys_, dir_ino, 0, nullptr /* block_buf */, |