From: Pauli Date: Wed, 9 Dec 2020 11:43:21 +0000 (+1000) Subject: rand: don't leak memory X-Git-Tag: openssl-3.0.0-alpha10~106 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a678506e2fa1826fc3a836b66fe9110f29306a32;p=thirdparty%2Fopenssl.git rand: don't leak memory Reviewed-by: Richard Levitte Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/13640) --- diff --git a/providers/implementations/rands/seed_src.c b/providers/implementations/rands/seed_src.c index 95574abd8a9..0a533d016fa 100644 --- a/providers/implementations/rands/seed_src.c +++ b/providers/implementations/rands/seed_src.c @@ -111,7 +111,7 @@ static int seed_src_generate(void *vseed, unsigned char *out, size_t outlen, entropy_available = ossl_pool_acquire_entropy(pool); if (entropy_available > 0) - memcpy(out, rand_pool_detach(pool), rand_pool_length(pool)); + memcpy(out, rand_pool_buffer(pool), rand_pool_length(pool)); rand_pool_free(pool); return entropy_available > 0;