]> git.ipfire.org Git - thirdparty/openssl.git/commit
RAND_write_file(): Avoid potential file descriptor leak
authorshridhar kalavagunta <coolshrid@hotmail.com>
Sun, 4 Aug 2024 21:04:53 +0000 (16:04 -0500)
committerTomas Mraz <tomas@openssl.org>
Mon, 19 Aug 2024 09:10:43 +0000 (11:10 +0200)
commitd6048344398ec75996fee1f465abb61ab3aa377e
tree832845f57daa87a2d8600c636472d7cb1c636f17
parent4c37778a4e8d59124b761a63a08ca0512b7067d2
RAND_write_file(): Avoid potential file descriptor leak

If fdopen() call fails we need to close the fd. Also
return early as this is most likely some fatal error.

Fixes #25064

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25081)
crypto/rand/randfile.c