]> git.sur5r.net Git - openldap/commitdiff
fix dnValidate (leak and return SUCCESS)
authorPierangelo Masarati <ando@openldap.org>
Wed, 13 Feb 2002 19:25:58 +0000 (19:25 +0000)
committerPierangelo Masarati <ando@openldap.org>
Wed, 13 Feb 2002 19:25:58 +0000 (19:25 +0000)
servers/slapd/dn.c

index 896419dfbc2602d9cbe34b678effb37c47d85dc0..24b7c73ff7abb72d41d87f2eaa3c97dfa17b171a 100644 (file)
@@ -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;
 }
 
 /*