1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 09:27:59 +00:00

Add a check for NULL in pageant_forget_passphrases().

I've no reason to believe it will _currently_ be called with the
'passphrases' tree not even set up yet, but I managed to get that to
happen while playing about with experimental code just now, and it
seemed like a good safety check to keep in general.
This commit is contained in:
Simon Tatham 2015-05-14 09:16:26 +01:00
parent 75b7ba26d3
commit ef3959992e

View File

@ -1172,6 +1172,9 @@ static tree234 *passphrases = NULL;
*/
void pageant_forget_passphrases(void)
{
if (!passphrases) /* in case we never set it up at all */
return;
while (count234(passphrases) > 0) {
char *pp = index234(passphrases, 0);
smemclr(pp, strlen(pp));