yangsong8-a1 opened a new pull request, #17458:
URL: https://github.com/apache/nuttx/pull/17458
## Summary
When opening the file succeeds but reading the file fails in
modlib_initialize, this will result in the open file not be closed.
## Impact
bug fix
## Testing
When fd check configuration is enabled, executing the `adb shell ls` command
5000 times consecutively results in an error.
If a file is successfully opened in libelf_initialize but reading fails, it
will return directly without closing the file, leading to a file descriptor
(fd) leak.
```
libelf_initialize
...
_NX_OPEN
...
libelf_read // if failed, return without close
return ret;
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]