burnwcs.c 348 B

12345678910111213141516171819
  1. /*
  2. * 'Burn' a dynamically allocated wide string, in the sense of
  3. * destroying it beyond recovery: overwrite it with zeroes and then
  4. * free it.
  5. */
  6. #include <wchar.h>
  7. #include "defs.h"
  8. #include "misc.h"
  9. void burnwcs(wchar_t *string)
  10. {
  11. if (string) {
  12. smemclr(string, sizeof(*string) * wcslen(string));
  13. sfree(string);
  14. }
  15. }