blob: e270af9d2070698eca4523198bd3af64b11349b6 [file] [log] [blame]
// RUN: %clangxx_asan -O0 %s -o %t && %t 2>&1 | FileCheck %s
// Test the time() interceptor.
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main() {
time_t *tm = (time_t*)malloc(sizeof(time_t));
free(tm);
time_t t = time(tm);
printf("Time: %s\n", ctime(&t)); // NOLINT
// CHECK: use-after-free
return 0;
}