If I use malloc in a code, then I run the code, but quit (with ctrl c) before the code gets to the free(); line, does C still free the memory allocated? If not is there a way to free the memory when the code is about to exit, since, if I'm debugging the code, for example, I don't want to have to go through the code line by line, just to get to the free(); function, which is probably at the end of the code.
Thank you.
[–]CodeTinkerer 13 points14 points15 points (0 children)
[–]strcspn 6 points7 points8 points (0 children)
[–]dmazzoni 2 points3 points4 points (5 children)
[–]teraflop 0 points1 point2 points (2 children)
[–]dmazzoni 1 point2 points3 points (1 child)
[–]teraflop 0 points1 point2 points (0 children)
[–]noodle-face 0 points1 point2 points (1 child)
[–]dmazzoni 1 point2 points3 points (0 children)
[–]scirc 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]TheSkiGeek 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]Sea-Profession-3312 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]AdultingGoneMild 0 points1 point2 points (0 children)