Possible resource leak on FILE* removed in X509 parse
diff --git a/library/x509parse.c b/library/x509parse.c
index 3e99bdc..3ddfb14 100644
--- a/library/x509parse.c
+++ b/library/x509parse.c
@@ -1812,7 +1812,10 @@
     fseek( f, 0, SEEK_SET );
 
     if( ( *buf = (unsigned char *) malloc( *n + 1 ) ) == NULL )
+    {
+        fclose( f );
         return( POLARSSL_ERR_X509_MALLOC_FAILED );
+    }
 
     if( fread( *buf, 1, *n, f ) != *n )
     {