Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
examples/echo: do not leak an opened file when an error happens
In both `echo_load_private_key` and `echo_load_public_key`, when `len > MAX_DH_KEY_LEN`, the opened file is not closed before the function returns. Fix this possible resource leak by opening the file after checking `len`. This bug was found using clang's static analyzer: scan-build -enable-checker alpha.unix.Stream make
- Loading branch information