]> git.sur5r.net Git - openldap/commitdiff
Fix value_find_ex result
authorHoward Chu <hyc@openldap.org>
Mon, 14 Apr 2003 12:27:04 +0000 (12:27 +0000)
committerHoward Chu <hyc@openldap.org>
Mon, 14 Apr 2003 12:27:04 +0000 (12:27 +0000)
servers/slapd/value.c

index 3da4bc511f40110db4272b94cc2e17742293404c..8988171b4388a6adbf8b88696466818e0ce5b290 100644 (file)
@@ -235,7 +235,6 @@ int value_find_ex(
                }
        }
 
-       rc = LDAP_NO_SUCH_ATTRIBUTE;
        for ( i = 0; vals[i].bv_val != NULL; i++ ) {
                int match;
                const char *text;
@@ -244,10 +243,11 @@ int value_find_ex(
                        &vals[i], nval.bv_val == NULL ? val : &nval, &text );
 
                if( rc == LDAP_SUCCESS && match == 0 ) {
-                       break;
+                       sl_free( nval.bv_val, ctx );
+                       return rc;
                }
        }
 
        sl_free( nval.bv_val, ctx );
-       return rc;
+       return LDAP_NO_SUCH_ATTRIBUTE;
 }