]> 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 Development Team <asteriskteam@digium.com>
Thu, 14 Nov 2024 20:00:45 +0000 (20:00 +0000)
commit6208e9c31cd9038b1bcbe6c0176af54b1fc61612
treed372bd1ea39057d2c22fc7ca316d7f0438b53a2f
parentd54206221fefbe66eb0ecd607f2c3ffdcf4141c1
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
(cherry picked from commit b29776a5b0518264333c4e78afe6dcbe226ff273)
main/astfd.c