memory-leaks.cpp 195 字节
Newer Older
M
maweiye 已提交
1 2 3 4 5 6 7 8 9 10 11 12
// BUILD: clang -fsanitize=address %s -o %t
// CHECK: AddressSanitizer:Memory-leaks

#include <cstdlib>

void* p;

int main(int argc, char *argv[]) {
    p = malloc(7);
    p = 0;
    return 0;
}