]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-bdb/dn2entry.c
ITS#4088 force cursors to use same locker
[openldap] / servers / slapd / back-bdb / dn2entry.c
index 397b5f276fcf75044bcc8d9d4d3107118ccd5c63..5bdfd915b3a52a56e033593ed27e0accf615d2bf 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2000-2004 The OpenLDAP Foundation.
+ * Copyright 2000-2005 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -68,10 +68,12 @@ bdb_dn2entry(
                        *e = ei;
                } else if ( matched && rc == DB_NOTFOUND ) {
                        /* always return EntryInfo */
-                       ei = ei->bei_parent;
-                       rc2 = bdb_cache_find_id( op, tid, ei->bei_id, &ei, 1,
-                               locker, lock );
-                       if ( rc2 ) rc = rc2;
+                       if ( ei->bei_parent ) {
+                               ei = ei->bei_parent;
+                               rc2 = bdb_cache_find_id( op, tid, ei->bei_id, &ei, 1,
+                                       locker, lock );
+                               if ( rc2 ) rc = rc2;
+                       }
                        *e = ei;
                }
        }