]> git.sur5r.net Git - openldap/commitdiff
ITS#7203 approxIndexer should omit zero-length keys
authorHoward Chu <hyc@openldap.org>
Fri, 9 Mar 2012 20:47:49 +0000 (12:47 -0800)
committerHoward Chu <hyc@openldap.org>
Fri, 9 Mar 2012 20:47:49 +0000 (12:47 -0800)
servers/slapd/schema_init.c

index dbf93df35c9b1aa73039769aaa2f9b0bee581d5d..080bd6a7add89b4e5a645c9ed8efa091d455e3c8 100644 (file)
@@ -2155,7 +2155,11 @@ approxIndexer(
                        len = strlen( c );
                        if( len < SLAPD_APPROX_WORDLEN ) continue;
                        ber_str2bv( phonetic( c ), 0, 0, &keys[keycount] );
-                       keycount++;
+                       if( keys[keycount].bv_len ) {
+                               keycount++;
+                       } else {
+                               ch_free( keys[keycount].bv_val );
+                       }
                        i++;
                }