Created
May 29, 2016 01:12
-
-
Save PsySc0rpi0n/4d1cb9a099e07b90d520905a5d89fadc to your computer and use it in GitHub Desktop.
A secure way to free memory
This file contains 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 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