[Bug analyzer/100615] New: analyzer failed to report leak in rxtxcpu's parse_cpu_list
dmalcolm at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat May 15 18:23:12 GMT 2021
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100615
Bug ID: 100615
Summary: analyzer failed to report leak in rxtxcpu's
parse_cpu_list
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: analyzer
Assignee: dmalcolm at gcc dot gnu.org
Reporter: dmalcolm at gcc dot gnu.org
Target Milestone: ---
clang's static analyzer found this leak on an error-handling path:
https://github.com/stackpath/rxtxcpu/pull/42
which gcc's -fanalyzer failed to report.
Looking at the code, I see that the string is passed to strsep and to strtol,
which IIRC the analyzer doesn't have special knowledge of (perhaps the analyzer
is conservatively assuming that these could free the string?)
More information about the Gcc-bugs
mailing list