copyright
[openssl.git] / crypto / mem_dbg.c
index 4e851de3d82197fc89b7313acb8f7f3e043d2014..1c4e04f51fc480f70e655815157096a9ef40efa5 100644 (file)
@@ -737,8 +737,13 @@ void CRYPTO_mem_leaks_fp(FILE *fp)
        BIO *b;
 
        if (mh == NULL) return;
-       if ((b=BIO_new(BIO_s_file())) == NULL)
-               return;
+       /* Need to turn off memory checking when allocated BIOs ... especially
+        * as we're creating them at a time when we're trying to check we've not
+        * left anything un-free()'d!! */
+       MemCheck_off();
+       b = BIO_new(BIO_s_file());
+       MemCheck_on();
+       if(!b) return;
        BIO_set_fp(b,fp,BIO_NOCLOSE);
        CRYPTO_mem_leaks(b);
        BIO_free(b);