1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 01:48:00 +00:00

Fix a null-dereference introduced by another mis-fix in r9919.

[originally from svn r9946]
[r9919 == ea301bdd9b]
This commit is contained in:
Simon Tatham 2013-07-20 13:15:20 +00:00
parent adf8b3222f
commit 1073d229ae

View File

@ -1247,11 +1247,15 @@ int sshcom_encrypted(const Filename *filename, char **comment)
answer = 1; answer = 1;
done: done:
*comment = dupstr(key ? key->comment : ""); if (key) {
smemclr(key->keyblob, key->keyblob_size); *comment = dupstr(key->comment);
sfree(key->keyblob); smemclr(key->keyblob, key->keyblob_size);
smemclr(key, sizeof(*key)); sfree(key->keyblob);
sfree(key); smemclr(key, sizeof(*key));
sfree(key);
} else {
*comment = dupstr("");
}
return answer; return answer;
} }