[llvm-bugs] [Bug 35729] New: False positive when returning an inner pointer from malloc'ed block
via llvm-bugs
llvm-bugs at lists.llvm.org
Fri Dec 22 02:02:47 PST 2017
https://bugs.llvm.org/show_bug.cgi?id=35729
Bug ID: 35729
Summary: False positive when returning an inner pointer from
malloc'ed block
Product: clang
Version: 4.0
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Static Analyzer
Assignee: dcoughlin at apple.com
Reporter: christopher.crouzet at gmail.com
CC: llvm-bugs at lists.llvm.org
Created attachment 19594
--> https://bugs.llvm.org/attachment.cgi?id=19594&action=edit
main.c
Hello,
As suggested by the FAQ
(https://clang-analyzer.llvm.org/faq.html#suppress_issue), I am here to report
what I (and Valgrind) believe is a false positive.
When implementing an aligned allocator, it is common to allocate a block and
return to the user only a different pointer located within the block, which
Clang Static Analyzer flags as a potential leak of memory.
Attached is a short code snippet that triggers the false positive.
Regards,
Christopher.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171222/065c7913/attachment-0001.html>
More information about the llvm-bugs
mailing list