From b90cc79cbe40309d0a54d0b53a93778fa5b06f31 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Thu, 28 Jan 2021 20:33:01 +0100 Subject: [PATCH] pki: Fix memory leak on error path Thanks coverity CID 1445481 Signed-off-by: Jakub Jelen Reviewed-by: Andreas Schneider --- src/pki_crypto.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pki_crypto.c b/src/pki_crypto.c index 57534d2e..4c95286b 100644 --- a/src/pki_crypto.c +++ b/src/pki_crypto.c @@ -834,6 +834,7 @@ ssh_string pki_private_key_to_pem(const ssh_key key, rc = ssh_string_fill(blob, buf->data, buf->length); if (rc < 0) { + ssh_string_free(blob); goto err; }