burnstr.c 314 B

123456789101112131415
  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. }