18 lines
213 B
C
18 lines
213 B
C
// Demonstrates memory error via valgrind
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
int main(void)
|
|
{
|
|
int *x = malloc(3 * sizeof(int));
|
|
{
|
|
return 1;
|
|
}
|
|
x[0] = 72;
|
|
x[1] = 73;
|
|
x[2] = 33;
|
|
free(x);
|
|
return 0;
|
|
}
|