]> git.sur5r.net Git - openldap/commitdiff
Don't avl_insert NULL kids
authorHoward Chu <hyc@openldap.org>
Fri, 23 May 2003 01:12:50 +0000 (01:12 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 23 May 2003 01:12:50 +0000 (01:12 +0000)
servers/slapd/back-bdb/cache.c

index e3630367c05383ea0dafaa0f4aa2eee5e963f7ba..7b78809cdc7837d0ceeb5f17cf14df465aadadb0 100644 (file)
@@ -450,10 +450,12 @@ bdb_cache_find_parent(
                        bdb_cache_entryinfo_destroy( ein );
                        ein = (EntryInfo *)avl_find( bdb->bi_cache.c_idtree,
                                (caddr_t) &ei, bdb_id_cmp );
-                       bdb_cache_entryinfo_lock( ein );
-                       avl_insert( &ein->bei_kids, (caddr_t)ei2, bdb_rdn_cmp,
-                               avl_dup_error );
-                       bdb_cache_entryinfo_unlock( ein );
+                       if ( ei2 ) {
+                               bdb_cache_entryinfo_lock( ein );
+                               avl_insert( &ein->bei_kids, (caddr_t)ei2,
+                                       bdb_rdn_cmp, avl_dup_error );
+                               bdb_cache_entryinfo_unlock( ein );
+                       }
                }
 
                /* If this is the first time, save this node