Skip to content

Instantly share code, notes, and snippets.

@swilly22
Last active September 15, 2019 07:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save swilly22/c1f6fffc1b6e99acb6469ed4b0ce19e9 to your computer and use it in GitHub Desktop.
Save swilly22/c1f6fffc1b6e99acb6469ed4b0ce19e9 to your computer and use it in GitHub Desktop.
void f(void) {
void *a = NULL;
void *b = NULL;
void *c = NULL;
a = malloc(32);
//...
if(cond1) {
free(a)
return;
}
b = malloc(64);
//...
if(cond2) {
free(a);
free(b);
return;
}
c = malloc(128);
//...
free(a);
free(b);
free(c);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment