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