Skip to content

Instantly share code, notes, and snippets.

@PsySc0rpi0n
Created May 29, 2016 01:12
Show Gist options
  • Save PsySc0rpi0n/4d1cb9a099e07b90d520905a5d89fadc to your computer and use it in GitHub Desktop.
Save PsySc0rpi0n/4d1cb9a099e07b90d520905a5d89fadc to your computer and use it in GitHub Desktop.
A secure way to free memory
void SecFree (void** memRef) {
if (memRef != NULL && *memRef != NULL){
free (*memRef);
*memRef = NULL;
}
}
//usage
secFree ((void** ) &memRef);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment