]> 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)
committerasterisk-org-access-app[bot] <120671045+asterisk-org-access-app[bot]@users.noreply.github.com>
Wed, 25 Sep 2024 18:27:20 +0000 (18:27 +0000)
commita988506a3e8dc19e08150523bc66068ed8873d0a
tree5d6a8388bd9682eecdef2edc6d4f79b3e3db6332
parentadfc1846ef05caf5cbb86834d357d77946e8ff82
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