The static analysis tool cppcheck will show that the function mbedtls_pkcs7_load_file does not properly close the opened file if memory allocation fails for the data buf. This commit ensures that, if a memory allocation error does occur, the opened file will be closed before returning.
The static analysis tool
cppcheck
will show that the functionmbedtls_pkcs7_load_file
does not properly close the opened file if memory allocation fails for the databuf
. This commit ensures that, if a memory allocation error does occur, the opened file will be closed before returning.Signed-off-by: Nick Child nick.child@ibm.com