]> git.sur5r.net Git - openldap/commitdiff
Fix ITS#4450, don't overwrite remote server's rs->sr_text
authorHoward Chu <hyc@openldap.org>
Tue, 16 May 2006 21:30:10 +0000 (21:30 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 16 May 2006 21:30:10 +0000 (21:30 +0000)
servers/slapd/back-ldap/search.c

index de4180e65aba33d65eeed5195a14b468a44c2f74..dbe612d5497ef5b10f393604b6798d7fa71e6331 100644 (file)
@@ -375,16 +375,19 @@ retry:
                        }
 
                } else {
-                       char            **references = NULL;
+                       char            **references = NULL, *err = NULL;
 
                        rc = ldap_parse_result( lc->lc_ld, res, &rs->sr_err,
-                                       &match.bv_val, (char **)&rs->sr_text,
+                                       &match.bv_val, &err,
                                        &references, &rs->sr_ctrls, 1 );
-                       freetext = 1;
                        if ( rc != LDAP_SUCCESS ) {
                                rs->sr_err = rc;
                        }
                        rs->sr_err = slap_map_api2result( rs );
+                       if ( err ) {
+                               rs->sr_text = err;
+                               freetext = 1;
+                       }
 
                        if ( references && references[ 0 ] && references[ 0 ][ 0 ] ) {
                                int     cnt;