Created
March 11, 2025 14:40
-
-
Save lovemycodesnippets/b348ed6d5790da9eaf1936bf7fa4ec8d to your computer and use it in GitHub Desktop.
From the TNS post on TrapC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main() | |
{ int* p = malloc(sizeof(int)); | |
free(p);//TrapC ignores free, p not freed yet | |
*p = 10;//UB in C, no problem in TrapC | |
return 0;//Leaving Scope, TrapC now frees p automatically | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment