memory leak
Mon Jun 13 2022 18:02:54 GMT+0000 (Coordinated Universal Time)
Saved by
@KanishqJ8
int main()
{
int a, i = 0;
int *i2;
while (i < 45545)
{
printf("Welcome to Code With Harry\n");
i2 = malloc(34444 * sizeof(int));
if (i % 100 == 0)
{
getchar();
}
i++;
free(i2); // Without this we will encounter a situation of memory leak
}
return 0;
}
content_copyCOPY
Comments