// memory-leak
|
|
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
#include <assert.h>
|
|
|
|
int main() {
|
|
for (int i = 0; i < 10; ++i) {
|
|
int *ptr = malloc(sizeof(*ptr));
|
|
assert(ptr != 0);
|
|
*ptr = i;
|
|
}
|
|
return 0;
|
|
}
|