From f8b6cf5b3a31d24aa10004f1b9e98171b706bd8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Wed, 27 Aug 2008 11:14:17 +0000 Subject: [PATCH] check for duplicates git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23701 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/krb5/plugin.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/krb5/plugin.c b/lib/krb5/plugin.c index fb1ee3228..8b24d5710 100644 --- a/lib/krb5/plugin.c +++ b/lib/krb5/plugin.c @@ -137,6 +137,11 @@ krb5_plugin_register(krb5_context context, { struct plugin *e; + /* check for duplicates */ + for (e = registered; e != NULL; e = e->next) + if (e->type == type && strcmp(e->name,name)== 0 && e->symbol == symbol) + return 0; + e = calloc(1, sizeof(*e)); if (e == NULL) { krb5_set_error_message(context, ENOMEM, "malloc: out of memory");