http://llvm.org/bugs/show_bug.cgi?id=17596
Bug ID: 17596
Summary: False positive "Potential leak of memory pointed to
by"
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: Static Analyzer
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
The following code:
$ cat minimal.c
#include <string.h>
union u {
int i;
char *s;
};
void f(union u uu);
void g(void)
{
union u uu;
uu.s = strdup("");
f(uu);
}
$ scan-build clang -Wall -c minimal.c -o minimal.o
yields:
scan-build: Using '/usr/bin/clang' for static analysis
minimal.c:14:2: warning: Potential leak of memory pointed to by 'uu.s'
f(uu);
^~~~~
1 warning generated.
scan-build: 1 bugs found.
f will take ownership of the pointer.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs