summaryrefslogtreecommitdiff
path: root/src/charon/plugins/medsrv/medsrv_creds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/charon/plugins/medsrv/medsrv_creds.c')
-rw-r--r--src/charon/plugins/medsrv/medsrv_creds.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/charon/plugins/medsrv/medsrv_creds.c b/src/charon/plugins/medsrv/medsrv_creds.c
index 48e05c38e..5d2d46e53 100644
--- a/src/charon/plugins/medsrv/medsrv_creds.c
+++ b/src/charon/plugins/medsrv/medsrv_creds.c
@@ -12,7 +12,7 @@
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
- * $Id: medsrv_creds.c 4061 2008-06-11 14:13:24Z martin $
+ * $Id: medsrv_creds.c 4317 2008-09-02 11:00:13Z martin $
*/
#include "medsrv_creds.h"
@@ -67,7 +67,7 @@ static bool cert_enumerator_enumerate(cert_enumerator_t *this,
while (this->inner->enumerate(this->inner, &chunk))
{
public = lib->creds->create(lib->creds, CRED_PUBLIC_KEY, KEY_ANY,
- BUILD_BLOB_ASN1_DER, chunk_clone(chunk),
+ BUILD_BLOB_ASN1_DER, chunk,
BUILD_END);
if (public)
{
@@ -76,14 +76,17 @@ static bool cert_enumerator_enumerate(cert_enumerator_t *this,
trusted = lib->creds->create(lib->creds,
CRED_CERTIFICATE, CERT_TRUSTED_PUBKEY,
BUILD_PUBLIC_KEY, public, BUILD_END);
+ public->destroy(public);
if (trusted)
{
*cert = this->current = trusted;
return TRUE;
}
- continue;
}
- public->destroy(public);
+ else
+ {
+ public->destroy(public);
+ }
}
}
this->current = NULL;