check for duplicates

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23701 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2008-08-27 11:14:17 +00:00
parent f7090285fd
commit f8b6cf5b3a

View File

@@ -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");