Skip to main content
๐Ÿ› Bug HuntC C Hardโšก+35 XP

Double Free

This code causes heap corruption.

๐Ÿ› Find the bug
1int *p = malloc(sizeof(int));
2*p = 42;
3free(p);
4free(p);
๐Ÿ› The bug is on line 4

๐Ÿ”ง Select the correct fix: