lite: nnapi: Fix fd leak in NNMemory's destructor
Valid fd values are non-negative, including zero. Signed-off-by: Waqar Hameed <whame91@gmail.com>
This commit is contained in:
parent
076b5be77d
commit
46ff46bd09
@ -676,7 +676,7 @@ NNMemory::~NNMemory() {
|
||||
if (nn_memory_handle_) {
|
||||
nnapi_->ANeuralNetworksMemory_free(nn_memory_handle_);
|
||||
}
|
||||
if (fd_ > 0) close(fd_);
|
||||
if (fd_ >= 0) close(fd_);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user