cppcheck/samples/memleak/good.c

12 lines
143 B
C

#include <stdlib.h>
int main()
{
int result;
char *a = malloc(10);
a[0] = 0;
result = a[0];
free(a);
return result;
}