mirror of
https://github.com/yuzu-emu/mbedtls
synced 2024-11-24 11:08:09 +00:00
Avoid fclose( NULL )
Found by Coverity Scan.
This commit is contained in:
parent
7f9049baf4
commit
bcc030849a
1 changed files with 3 additions and 6 deletions
|
@ -284,13 +284,10 @@ int mbedtls_md_file( const mbedtls_md_info_t *md_info, const char *path, unsigne
|
|||
if( md_info == NULL )
|
||||
return( MBEDTLS_ERR_MD_BAD_INPUT_DATA );
|
||||
|
||||
mbedtls_md_init( &ctx );
|
||||
|
||||
if( ( f = fopen( path, "rb" ) ) == NULL )
|
||||
{
|
||||
ret = MBEDTLS_ERR_MD_FILE_IO_ERROR;
|
||||
goto cleanup;
|
||||
}
|
||||
return( MBEDTLS_ERR_MD_FILE_IO_ERROR );
|
||||
|
||||
mbedtls_md_init( &ctx );
|
||||
|
||||
if( ( ret = mbedtls_md_setup( &ctx, md_info, 0 ) ) != 0 )
|
||||
goto cleanup;
|
||||
|
|
Loading…
Reference in a new issue