brintos

brintos / llvm-project-archived public Read only

0
0
Text · 313 B · 9fd34fe Raw
17 lines · cpp
1// RUN: %clang_cl_asan %s -Fe%t.exe
2// RUN: %run %t.exe | FileCheck %s
3
4// CHECK: Success
5
6#include <malloc.h>
7#include <stdio.h>
8#include <string.h>
9
10int main() {
11  // Null input is valid to strdup on Windows.
12  char *nullStr = _strdup(nullptr);
13  free(nullStr);
14  puts("Success");
15  return 0;
16}
17