From e1334fa57cee9dd54406a09c0b48dc73a09aa19b Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Thu, 17 May 2007 15:05:13 +0000 Subject: [PATCH] Do not free public key in failure in silc_show_public_key. --- lib/silcapputil/silcapputil.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/silcapputil/silcapputil.c b/lib/silcapputil/silcapputil.c index 97348172..67df01eb 100644 --- a/lib/silcapputil/silcapputil.c +++ b/lib/silcapputil/silcapputil.c @@ -287,18 +287,14 @@ SilcBool silc_show_public_key(SilcPublicKey public_key) SilcUInt32 key_len = 0; silc_pubkey = silc_pkcs_get_context(SILC_PKCS_SILC, public_key); - if (!silc_pubkey) { - silc_pkcs_public_key_free(public_key); + if (!silc_pubkey) return FALSE; - } ident = &silc_pubkey->identifier; key_len = silc_pkcs_public_key_get_len(public_key); pk = silc_pkcs_public_key_encode(public_key, &pk_len); - if (!pk) { - silc_pkcs_public_key_free(public_key); + if (!pk) return FALSE; - } fingerprint = silc_hash_fingerprint(NULL, pk, pk_len); babbleprint = silc_hash_babbleprint(NULL, pk, pk_len); -- 2.24.0