pki_crypto: Fix memory leak

Fixed memory leak in pki_publickey_to_blob when using an EC type of
hostkey.

Signed-off-by: roytak <xjanot04@stud.fit.vutbr.cz>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
roytak
2023-04-06 14:04:22 +02:00
committed by Jakub Jelen
parent f9147a3cf4
commit 49490ac06d

View File

@@ -1499,6 +1499,8 @@ ssh_string pki_publickey_to_blob(const ssh_key key)
#endif /* OPENSSL_VERSION_NUMBER */
e = pki_key_make_ecpoint_string(group, point);
EC_GROUP_free(group);
EC_POINT_free(point);
if (e == NULL) {
SSH_BUFFER_FREE(buffer);
return NULL;