]> git.sur5r.net Git - openldap/commitdiff
ITS#7190 don't crash in slapcat on NULL entry
authorHoward Chu <hyc@openldap.org>
Wed, 7 Mar 2012 06:15:51 +0000 (22:15 -0800)
committerHoward Chu <hyc@openldap.org>
Wed, 7 Mar 2012 06:15:51 +0000 (22:15 -0800)
servers/slapd/back-mdb/tools.c

index 7dbb136ebc3fad879fe33b676bd56ce8e217a302..42d2c420a03262194cab559becfe85234a86f5d2 100644 (file)
@@ -335,8 +335,10 @@ mdb_tool_entry_get_int( BackendDB *be, ID id, Entry **ep )
                rc = mdb_id2name( &op, txn, &idcursor, id, &dn, &ndn );
                if ( rc  ) {
                        rc = LDAP_OTHER;
-                       mdb_entry_return( &op, e );
-                       e = NULL;
+                       if ( e ) {
+                               mdb_entry_return( &op, e );
+                               e = NULL;
+                       }
                        goto done;
                }
                if ( tool_base != NULL ) {