burnstr.c 299 B

12345678910111213141516
  1. /*
  2. * 'Burn' a dynamically allocated string, in the sense of destroying
  3. * it beyond recovery: overwrite it with zeroes and then free it.
  4. */
  5. #include "defs.h"
  6. #include "misc.h"
  7. void burnstr(char *string)
  8. {
  9. if (string) {
  10. smemclr(string, strlen(string));
  11. sfree(string);
  12. }
  13. }