1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-08-08 19:02:06 +03:00

pki: Fix a memory leak.

CID #1132819
This commit is contained in:
Andreas Schneider
2013-11-28 09:09:45 +01:00
parent 004240af48
commit cdd7a6cb8d

View File

@@ -524,6 +524,7 @@ int ssh_pki_export_privkey_file(const ssh_key privkey,
} }
rc = fwrite(ssh_string_data(blob), ssh_string_len(blob), 1, fp); rc = fwrite(ssh_string_data(blob), ssh_string_len(blob), 1, fp);
ssh_string_free(blob);
if (rc != 1 || ferror(fp)) { if (rc != 1 || ferror(fp)) {
fclose(fp); fclose(fp);
unlink(filename); unlink(filename);