From 6e88ea7108b20015338fbcdf060d91ebce7b7abe Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Wed, 13 Feb 2002 19:25:58 +0000 Subject: [PATCH] fix dnValidate (leak and return SUCCESS) --- servers/slapd/dn.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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; } /* -- 2.39.5