diff --git a/src/pki.c b/src/pki.c index e0209cd6..22143cb6 100644 --- a/src/pki.c +++ b/src/pki.c @@ -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); if (rc != 0) { + ssh_buffer_free(cert_buffer); return SSH_ERROR; }