21 lines
326 B
C
21 lines
326 B
C
#include <malloc.h>
|
|
#include <stdlib.h>
|
|
#include "leak_detector_c.h"
|
|
int main()
|
|
{
|
|
atexit(report_mem_leak);
|
|
|
|
char *ptr1 = (char *)malloc(1);
|
|
|
|
|
|
|
|
|
|
int *ptr2 = (int *)calloc(1, sizeof(int));
|
|
float * ptr3 = (float *) calloc(15, sizeof(float));
|
|
free(ptr2);
|
|
|
|
dump_mem_leak();
|
|
|
|
return 0;
|
|
}
|