]> git.ipfire.org Git - thirdparty/asterisk.git/commit
astfd.c: Avoid calling fclose with NULL argument.
authorNaveen Albert <asterisk@phreaknet.org>
Tue, 24 Sep 2024 11:29:59 +0000 (07:29 -0400)
committerNaveen Albert <asterisk@phreaknet.org>
Wed, 25 Sep 2024 18:27:17 +0000 (18:27 +0000)
commit7c982de5c6f56271b8866fd9ecc38d6b2975e986
tree32e68e55541a7682ce0e02ffdd8d64f2f7d96ec6
parentf3e74d34ce2fdd7eb60fc21d759c7abc19639f21
astfd.c: Avoid calling fclose with NULL argument.

Don't pass through a NULL argument to fclose, which is undefined
behavior, and instead return -1 and set errno appropriately. This
also avoids a compiler warning with glibc 2.38 and newer, as glibc
commit 71d9e0fe766a3c22a730995b9d024960970670af
added the nonnull attribute to this argument.

Resolves: #900
main/astfd.c