mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 17:38:00 +00:00
Fix duplicated exit code in ppk_load_s.
There's no need to have one bunch of free operations before returning success and another version before returning error. Easier to just set up the state in the former case so that we can fall through to the latter.
This commit is contained in:
parent
ce60ca727c
commit
29b8e26f7d
10
sshpubk.c
10
sshpubk.c
@ -800,14 +800,13 @@ ssh2_userkey *ppk_load_s(BinarySource *src, const char *passphrase,
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sfree(mac);
|
|
||||||
mac = NULL;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create and return the key.
|
* Create and return the key.
|
||||||
*/
|
*/
|
||||||
ret = snew(ssh2_userkey);
|
ret = snew(ssh2_userkey);
|
||||||
ret->comment = comment;
|
ret->comment = comment;
|
||||||
|
comment = NULL;
|
||||||
ret->key = ssh_key_new_priv(
|
ret->key = ssh_key_new_priv(
|
||||||
alg, ptrlen_from_strbuf(public_blob),
|
alg, ptrlen_from_strbuf(public_blob),
|
||||||
ptrlen_from_strbuf(private_blob));
|
ptrlen_from_strbuf(private_blob));
|
||||||
@ -817,12 +816,7 @@ ssh2_userkey *ppk_load_s(BinarySource *src, const char *passphrase,
|
|||||||
error = "createkey failed";
|
error = "createkey failed";
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
strbuf_free(public_blob);
|
error = NULL;
|
||||||
strbuf_free(private_blob);
|
|
||||||
sfree(encryption);
|
|
||||||
if (errorstr)
|
|
||||||
*errorstr = NULL;
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Error processing.
|
* Error processing.
|
||||||
|
Loading…
Reference in New Issue
Block a user