From 137484895a4ca8d78e05e5055400d38c7eed13f6 Mon Sep 17 00:00:00 2001 From: Andreas Steffen Date: Wed, 12 Nov 2008 04:08:30 +0000 Subject: [PATCH] improved fix --- src/charon/config/proposal.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/charon/config/proposal.c b/src/charon/config/proposal.c index 7c075234d..1421d5e97 100644 --- a/src/charon/config/proposal.c +++ b/src/charon/config/proposal.c @@ -210,17 +210,21 @@ static bool get_algorithm(private_proposal_t *this, transform_type_t type, u_int16_t *alg, u_int16_t *key_size) { enumerator_t *enumerator; - bool found = FALSE; + bool found; - if (key_size) - { - *key_size = 0; /* Just in case no algorithm is found */ - } enumerator = create_enumerator(this, type); if (enumerator->enumerate(enumerator, alg, key_size)) { found = TRUE; } + else + { + if (key_size) + { + *key_size = 0; + } + found = FALSE; + } enumerator->destroy(enumerator); return found; }