summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2020-10-14 04:49:11 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2020-10-14 04:49:11 +0000
commit249e93788723f1132e11e9621412e2910114f46b (patch)
treebf7773a6a5f9c128cbdc5ccdcac13795953bbd70
parent7dfee7e7b712f0e002d1dac7781123df846e057a (diff)
parentb3270e4ecea5df12fb4c57bb56f8dfb19bbf1f1f (diff)
downloadml-249e93788723f1132e11e9621412e2910114f46b.tar.gz
Merge "Add to close copied dupfd."
-rw-r--r--nn/runtime/Memory.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/nn/runtime/Memory.cpp b/nn/runtime/Memory.cpp
index fb97af55b..ee9faf934 100644
--- a/nn/runtime/Memory.cpp
+++ b/nn/runtime/Memory.cpp
@@ -558,6 +558,7 @@ std::pair<int, std::unique_ptr<MemoryFd>> MemoryFd::create(size_t size, int prot
native_handle_t* nativeHandle = native_handle_create(1, 3);
if (nativeHandle == nullptr) {
LOG(ERROR) << "Failed to create native_handle";
+ close(dupfd);
// TODO(b/120417090): is ANEURALNETWORKS_UNEXPECTED_NULL the correct
// error to return here?
return {ANEURALNETWORKS_UNEXPECTED_NULL, nullptr};