Commit 1e3a9b65 authored by Bodo Möller's avatar Bodo Möller
Browse files

allocate bio_err before memory debugging is enabled to avoid memory leaks

(we can't release it before the CRYPTO_mem_leaks() call!)

Submitted by: Nils Larsch
parent 229dc0ee
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -386,6 +386,8 @@ int main(int argc, char *argv[])
	debug = 0;
	debug = 0;
	cipher = 0;
	cipher = 0;


	bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);	

	CRYPTO_set_locking_callback(lock_dbg_cb);
	CRYPTO_set_locking_callback(lock_dbg_cb);


	/* enable memory leak checking unless explicitly disabled */
	/* enable memory leak checking unless explicitly disabled */
@@ -403,7 +405,6 @@ int main(int argc, char *argv[])


	RAND_seed(rnd_seed, sizeof rnd_seed);
	RAND_seed(rnd_seed, sizeof rnd_seed);


	bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
	bio_stdout=BIO_new_fp(stdout,BIO_NOCLOSE);
	bio_stdout=BIO_new_fp(stdout,BIO_NOCLOSE);


	argc--;
	argc--;