mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-08-08 19:02:06 +03:00
pki: Fix a memory leak on error in ssh_pki_copy_cert_to_privkey()
CID 1323516 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@@ -1408,6 +1408,7 @@ int ssh_pki_copy_cert_to_privkey(const ssh_key certkey, ssh_key privkey) {
|
|||||||
|
|
||||||
rc = buffer_add_buffer(cert_buffer, certkey->cert);
|
rc = buffer_add_buffer(cert_buffer, certkey->cert);
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
|
ssh_buffer_free(cert_buffer);
|
||||||
return SSH_ERROR;
|
return SSH_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user