cours/content/secu_logicielle/td7-analyse_statique_dynamique/files/q2/test-leak.c
2023-05-09 21:57:14 +02:00

24 lines
273 B
C

#include <stdlib.h>
#include <stdio.h>
static char *f(void) {
char *c = malloc(10);
char *d = malloc(20);
c[0] = 0;
d[0] = 0;
return c;
}
static void g(void) {
char *e = f();
printf("%p\n", e);
}
static void h(void) {
g();
}
int main(void) {
h();
return 0;
}