Home | History | Annotate | Download | only in TestCases
      1 // RUN: %clangxx_asan -O0 %s -o %t && not %t 2>&1 | FileCheck %s
      2 
      3 // Test the time() interceptor.
      4 
      5 #include <stdio.h>
      6 #include <stdlib.h>
      7 #include <time.h>
      8 
      9 int main() {
     10   time_t *tm = (time_t*)malloc(sizeof(time_t));
     11   free(tm);
     12   time_t t = time(tm);
     13   printf("Time: %s\n", ctime(&t));  // NOLINT
     14   // CHECK: use-after-free
     15   return 0;
     16 }
     17