X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fmr.c;h=4ca235e7e518df32e7d2c04bd84f01f37eba7c2f;hb=672f8ef3f39ed6008c1ff267847e32de59c5eeaf;hp=e810c3764871f5eb85c89f645245cc279ad9a332;hpb=761f2879435deec0dc8369de98381557de416b89;p=openldap diff --git a/servers/slapd/mr.c b/servers/slapd/mr.c index e810c37648..4ca235e7e5 100644 --- a/servers/slapd/mr.c +++ b/servers/slapd/mr.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 1998-2004 The OpenLDAP Foundation. + * Copyright 1998-2006 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -169,6 +169,7 @@ mr_add( for( i=0; def->mrd_compat_syntaxes[i]; i++ ) { compat_syn[i] = syn_find( def->mrd_compat_syntaxes[i] ); if( compat_syn[i] == NULL ) { + ch_free( compat_syn ); return SLAP_SCHERR_SYN_NOT_FOUND; } } @@ -198,10 +199,12 @@ mr_add( smr->smr_syntax = syn; } else { *err = smr->smr_syntax_oid; + ch_free( smr ); return SLAP_SCHERR_SYN_NOT_FOUND; } } else { *err = ""; + ch_free( smr ); return SLAP_SCHERR_MR_INCOMPLETE; } code = mr_insert(smr,err); @@ -217,9 +220,7 @@ register_matching_rule( int code; const char *err; - if( def->mrd_usage == SLAP_MR_NONE && - def->mrd_compat_syntaxes == NULL ) - { + if( def->mrd_usage == SLAP_MR_NONE && def->mrd_compat_syntaxes == NULL ) { Debug( LDAP_DEBUG_ANY, "register_matching_rule: not usable %s\n", def->mrd_desc, 0, 0 ); @@ -228,10 +229,9 @@ register_matching_rule( if( def->mrd_associated != NULL ) { amr = mr_find( def->mrd_associated ); - if( amr == NULL ) { - Debug( LDAP_DEBUG_ANY, "register_matching_rule: could not locate " - "associated matching rule %s for %s\n", + Debug( LDAP_DEBUG_ANY, "register_matching_rule: " + "could not locate associated matching rule %s for %s\n", def->mrd_associated, def->mrd_desc, 0 ); return -1; @@ -243,17 +243,15 @@ register_matching_rule( if (( def->mrd_usage & SLAP_MR_EQUALITY ) && (( def->mrd_usage & SLAP_MR_SUBTYPE_MASK ) != SLAP_MR_NONE )) { - Debug( LDAP_DEBUG_ANY, - "register_matching_rule: inappropriate (approx) association " - "%s for %s\n", + Debug( LDAP_DEBUG_ANY, "register_matching_rule: " + "inappropriate (approx) association %s for %s\n", def->mrd_associated, def->mrd_desc, 0 ); return -1; } } else if (!( amr->smr_usage & SLAP_MR_EQUALITY )) { - Debug( LDAP_DEBUG_ANY, - "register_matching_rule: inappropriate (equalilty) association " - "%s for %s\n", + Debug( LDAP_DEBUG_ANY, "register_matching_rule: " + "inappropriate (equalilty) association %s for %s\n", def->mrd_associated, def->mrd_desc, 0 ); return -1; }