diff --git a/library/pkparse.c b/library/pkparse.c index 39c51f648..83c93baa4 100644 --- a/library/pkparse.c +++ b/library/pkparse.c @@ -98,7 +98,10 @@ int pk_load_file( const char *path, unsigned char **buf, size_t *n ) if( fread( *buf, 1, *n, f ) != *n ) { fclose( f ); + + polarssl_zeroize( *buf, *n ); polarssl_free( *buf ); + return( POLARSSL_ERR_PK_FILE_IO_ERROR ); }