It's explicitly forbidden to call fclose with NULL, but at least on Darwin, this succeeds and doesn't segfault. To maintain binary compatibility, ASan should survice fclose(NULL) as well. Differential Revision: https://reviews.llvm.org/D40053 llvm-svn: 319347
14 lines
233 B
C
14 lines
233 B
C
// RUN: %clang_asan %s -o %t
|
|
// RUN: %run %t 2>&1 | FileCheck %s
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
int main(int argc, const char * argv[]) {
|
|
fclose(NULL);
|
|
fprintf(stderr, "Finished.\n");
|
|
return 0;
|
|
}
|
|
|
|
// CHECK: Finished.
|