mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-23 19:25:28 +00:00
Possible resource leak on FILE* removed in X509 parse
This commit is contained in:
parent
c72d3f7d85
commit
f6a19bd728
|
@ -1812,7 +1812,10 @@ int load_file( const char *path, unsigned char **buf, size_t *n )
|
||||||
fseek( f, 0, SEEK_SET );
|
fseek( f, 0, SEEK_SET );
|
||||||
|
|
||||||
if( ( *buf = (unsigned char *) malloc( *n + 1 ) ) == NULL )
|
if( ( *buf = (unsigned char *) malloc( *n + 1 ) ) == NULL )
|
||||||
|
{
|
||||||
|
fclose( f );
|
||||||
return( POLARSSL_ERR_X509_MALLOC_FAILED );
|
return( POLARSSL_ERR_X509_MALLOC_FAILED );
|
||||||
|
}
|
||||||
|
|
||||||
if( fread( *buf, 1, *n, f ) != *n )
|
if( fread( *buf, 1, *n, f ) != *n )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue