]> 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:13:23 +0000 (11:13 +0200)
commit9d74929c8bbc76e7779c01883081ab86d8903e65
tree728da85887bb392c3f8ee8ee07939c5f5a3d3a5d
parent0b4721c77b98f8cded9c9582b33a78ce1802399a
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)

(cherry picked from commit d6048344398ec75996fee1f465abb61ab3aa377e)
crypto/rand/randfile.c