Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[bug]: astfd.c: NULL pointer passed to fclose with nonnull attribute causes compilation failure #900

Description

@InterLinked1

Severity

Major

Versions

21.5.0-rc1

Components/Modules

astfd.c

Operating Environment

Ubuntu 24.04 / gcc 13.2.0

Frequency of Occurrence

Constant

Issue Description

As shown in log:

Relevant log output

[CCi] astfd.i -> astfd.o
astfd.c: In function ‘__ast_fdleak_fclose’:
astfd.c:283:24: error: argument 1 null where non-null expected [-Werror=nonnull]
  283 |                 return fclose(ptr);
      |                        ^~~~~~~~~~~
In file included from /usr/src/asterisk-21.5.0-rc1/include/asterisk/compat.h:49,
                 from /usr/src/asterisk-21.5.0-rc1/include/asterisk.h:22,
                 from astfd.c:30:
/usr/include/stdio.h:184:12: note: in a call to function ‘fclose’ declared ‘nonnull’
  184 | extern int fclose (FILE *__stream) __nonnull ((1));
      |            ^~~~~~
cc1: all warnings being treated as errors

Asterisk Issue Guidelines

  • Yes, I have read the Asterisk Issue Guidelines

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions