]> git.sur5r.net Git - openldap/commitdiff
handle failure or missing attrs
authorPierangelo Masarati <ando@openldap.org>
Fri, 4 Apr 2003 09:55:56 +0000 (09:55 +0000)
committerPierangelo Masarati <ando@openldap.org>
Fri, 4 Apr 2003 09:55:56 +0000 (09:55 +0000)
servers/slapd/back-ldap/search.c

index 2b54ac71b3ca53b7d363b302ca4b8ce20ff16321..3ef3b07ff4eb430895955ec0d86587dd341915ef 100644 (file)
@@ -488,11 +488,13 @@ ldap_build_entry(
                         * later, the local subschemaSubentry is
                         * added.
                         */
-                       ( void )ber_scanf( &ber, "[W]", &vals );
-                       for ( bv = vals; bv->bv_val; bv++ ) {
-                               LBER_FREE( bv->bv_val );
+                       if ( ber_scanf( &ber, "[W]", &vals ) != LBER_ERROR
+                                       && vals != NULL ) {
+                               for ( bv = vals; bv->bv_val; bv++ ) {
+                                       LBER_FREE( bv->bv_val );
+                               }
+                               LBER_FREE( vals );
                        }
-                       LBER_FREE( vals );
 
                        ch_free(attr);
                        continue;