mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 17:38:00 +00:00
Fix memory leak in rsa_ssh1_savekey.
The strbuf containing the data of the output key file was never freed.
This commit is contained in:
parent
6e7df89316
commit
85b1916ca6
@ -371,13 +371,14 @@ bool rsa_ssh1_savekey(const Filename *filename, RSAKey *key,
|
||||
* Done. Write the result to the file.
|
||||
*/
|
||||
fp = f_open(filename, "wb", true);
|
||||
bool ret = false;
|
||||
if (fp) {
|
||||
bool ret = (fwrite(buf->u, 1, buf->len, fp) == (size_t) (buf->len));
|
||||
ret = (fwrite(buf->u, 1, buf->len, fp) == (size_t) (buf->len));
|
||||
if (fclose(fp))
|
||||
ret = false;
|
||||
return ret;
|
||||
} else
|
||||
return false;
|
||||
}
|
||||
strbuf_free(buf);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user