Last active
September 15, 2019 10:30
-
-
Save swilly22/2fbffb6a51250e0e0ecf76985faa32e2 to your computer and use it in GitHub Desktop.
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
void f(void) { | |
void *a = NULL; | |
void *b = NULL; | |
void *c = NULL; | |
a = malloc(32); | |
//... | |
if(cond1) goto cleanup; | |
b = malloc(64); | |
//... | |
if(cond2) goto cleanup; | |
c = malloc(128); | |
//... | |
cleanup: | |
if(a) free(a); | |
if(b) free(b); | |
if(c) free(c); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment