1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-01 11:32:48 -05:00

Another utility function, to free a string containing sensitive data.

[originally from svn r9319]
This commit is contained in:
Simon Tatham
2011-10-02 14:03:47 +00:00
parent 535d77abf0
commit ff5a9c77fd
2 changed files with 9 additions and 0 deletions

8
misc.c
View File

@ -200,6 +200,14 @@ char *dupcat(const char *s1, ...)
return p;
}
void burnstr(char *string) /* sfree(str), only clear it first */
{
if (string) {
memset(string, 0, strlen(string));
sfree(string);
}
}
/*
* Do an sprintf(), but into a custom-allocated buffer.
*