Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Each bullet point links to an example (in C++) of what it looks like when ASan detects an error. They all start similar (ERROR: AddressSanitizer...) except for Memory leaks (ERROR: LeakSanitizer...). Two examples are provided below:

Code Block
languagecpp
themeEmacs
titleuse-after-free.c
#include <stdlib.h>
int main() {
  char *x = (char*)malloc(10 * sizeof(char*));
  free(x);
  return x[5];
}

...