Sign in
llvm
/
llvm-project
/
compiler-rt
/
9d7a9c3a8de8626c497db3a23226e7965ea2988e
/
.
/
test
/
lsan
/
TestCases
/
realloc_zero.c
blob: d4ce4754d9bdf8970fc9a15a1d9a3b085763d5b3 [
file
] [
log
] [
blame
]
// RUN: %clang_lsan %s -o %t
// RUN: %run %t
#include
<assert.h>
#include
<stdlib.h>
int
main
()
{
char
*
p
=
malloc
(
1
);
// The behavior of realloc(p, 0) is implementation-defined.
// We free the allocation.
assert
(
realloc
(
p
,
0
)
==
NULL
);
p
=
0
;
}