summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Christopher Ferris <cferris@google.com> 2022-05-03 16:05:16 -0700
committer Martijn Coenen <maco@google.com> 2022-09-20 09:13:15 +0000
commit60e4b9c43c8985a96ececf8b15e1f7e44f6b4c8f (patch)
tree64e3f0ba0f72dbb722fa28415d4c77ee133da29d
parent3244bf364da43237b902231bfcbaec4989c2e1d4 (diff)
Fix memory leak of FileDescriptorInfo object.
Bug: 231366539 Test: After fixing, there is no 192 byte leak present in most zygote Test: forked processes. Change-Id: Ie88e2fac76ba0da92c434d2db107885253855696
-rw-r--r--core/jni/fd_utils.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/jni/fd_utils.cpp b/core/jni/fd_utils.cpp
index 40f6e4f63cd7..5c71f692b80f 100644
--- a/core/jni/fd_utils.cpp
+++ b/core/jni/fd_utils.cpp
@@ -580,6 +580,7 @@ void FileDescriptorTable::RestatInternal(std::set<int>& open_fds, fail_fn_t fail
// TODO(narayan): This will be an error in a future android release.
// error = true;
// ALOGW("Zygote closed file descriptor %d.", it->first);
+ delete it->second;
it = open_fd_map_.erase(it);
} else {
// The entry from the file descriptor table is still open. Restat