repo.or.cz
/
llvm-project.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
[docs] Fix build-docs.sh
[llvm-project.git]
/
compiler-rt
/
test
/
lsan
/
TestCases
/
realloc_zero.c
blob
d4ce4754d9bdf8970fc9a15a1d9a3b085763d5b3
1
// RUN: %clang_lsan %s -o %t
2
// RUN: %run %t
3
4
#include <assert.h>
5
#include <stdlib.h>
6
7
int
main
() {
8
char
*
p
=
malloc
(
1
);
9
// The behavior of realloc(p, 0) is implementation-defined.
10
// We free the allocation.
11
assert
(
realloc
(
p
,
0
) ==
NULL
);
12
p
=
0
;
13
}