From 46b1f1091b9e1dde713cd0790450a0c089d5f0cf Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Mon, 26 Sep 2022 08:47:14 +0200 Subject: [PATCH] auth: Avoid double free Fixes CID 1498359 Thanks coverity Signed-off-by: Jakub Jelen Reviewed-by: Anderson Toshiyuki Sasaki --- src/auth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/auth.c b/src/auth.c index b55308ac..7f212548 100644 --- a/src/auth.c +++ b/src/auth.c @@ -967,7 +967,7 @@ int ssh_userauth_agent(ssh_session session, size_t pubkeyPathLen = strlen(privkeyFile) + sizeof(".pub"); if (pubkey) { - ssh_key_free(pubkey); + SSH_KEY_FREE(pubkey); } /* @@ -985,7 +985,7 @@ int ssh_userauth_agent(ssh_session session, if (rc == SSH_OK) { configKeys[configKeysCount++] = pubkey; } else if (pubkey) { - ssh_key_free(pubkey); + SSH_KEY_FREE(pubkey); } free(pubkeyFile); }