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

Trivial bug fix pointed out by Paul Fox: potentially missing fclose().

[originally from svn r4877]
This commit is contained in:
Simon Tatham 2004-11-22 11:02:44 +00:00
parent 4f6e453530
commit 15c96004a7

View File

@ -376,7 +376,8 @@ int saversakey(const Filename *filename, struct RSAKey *key, char *passphrase)
fp = f_open(*filename, "wb");
if (fp) {
int ret = (fwrite(buf, 1, p - buf, fp) == (size_t) (p - buf));
ret = ret && (fclose(fp) == 0);
if (fclose(fp))
ret = 0;
return ret;
} else
return 0;