]> 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:02:03 +0000 (20:02 +0000)
commit1372eeba513a3e2d0e626e746255d30abf893f87
treee854258eb2a8ccf12d80d604da65e402a547375d
parent2f44ac22b2693c0158946040d98e567ba85f0db2
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 2c583be963c8118c94cd0fecfbdae82ea617f951)
main/astfd.c