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: dcough...@apple.com
          Reporter: christopher.crou...@gmail.com
                CC: llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to