[llvm-bugs] [Bug 25701] New: False positive: memory leak reported for cast to union
llvm-bugs at lists.llvm.org
Tue Dec 1 18:12:48 PST 2015
Bug ID: 25701
Summary: False positive: memory leak reported for cast to union
Component: Static Analyzer
Assignee: kremenek at apple.com
Reporter: warren at icouldbedeadwrong.net
CC: llvm-bugs at lists.llvm.org
Created attachment 15378
Platform: Ubuntu 14.04.2 LTS
Tool version (svn info):
Relative URL: ^/cfe/trunk/tools/scan-build
Repository Root: http://llvm.org/svn/llvm-project
Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8
I have written a small test case (see attachment) - this code compiles and
passes through valgrind without issue. However, scan-build complains about a
possible memory leak, as follows:
/opt/llvm/libexec/ccc-analyzer -o union -g -Wall -Wextra union.c
union.c:25:5: warning: Potential leak of memory pointed to by 'ret'
1 warning generated.
(Note that the memory in question is freed on line 42).
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-bugs