From: Pierangelo Masarati Date: Wed, 13 Feb 2002 19:25:58 +0000 (+0000) Subject: fix dnValidate (leak and return SUCCESS) X-Git-Tag: OPENLDAP_REL_ENG_2_1_BP~14 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6e88ea7108b20015338fbcdf060d91ebce7b7abe;p=openldap fix dnValidate (leak and return SUCCESS) --- diff --git a/servers/slapd/dn.c b/servers/slapd/dn.c index 896419dfbc..24b7c73ff7 100644 --- a/servers/slapd/dn.c +++ b/servers/slapd/dn.c @@ -132,11 +132,13 @@ dnValidate( * Schema-aware validate */ rc = LDAPDN_validate( dn ); - if ( rc == LDAP_SUCCESS ) { - ldap_dnfree( dn ); + ldap_dnfree( dn ); + + if ( rc != LDAP_SUCCESS ) { + return LDAP_INVALID_SYNTAX; } - - return LDAP_INVALID_SYNTAX; + + return LDAP_SUCCESS; } /*