]> git.sur5r.net Git - openldap/commitdiff
fix previous commit (addresses ITS#4139)
authorPierangelo Masarati <ando@openldap.org>
Thu, 3 Nov 2005 21:48:46 +0000 (21:48 +0000)
committerPierangelo Masarati <ando@openldap.org>
Thu, 3 Nov 2005 21:48:46 +0000 (21:48 +0000)
servers/slapd/back-ldap/extended.c

index 7218af2e84f322b3d14de82d4f66aff25a1afde3..fde2c489b013af76e0cd0ab009216fb2aa52f5e4 100644 (file)
@@ -137,9 +137,11 @@ retry:
                                        NULL, NULL, 0 );
                        if ( rs->sr_matched && rs->sr_matched[ 0 ] == '\0' ) {
                                free( (char *)rs->sr_matched );
+                               rs->sr_matched = NULL;
                        }
                        if ( rs->sr_text && rs->sr_text[ 0 ] == '\0' ) {
                                free( (char *)rs->sr_text );
+                               rs->sr_text = NULL;
                        }
                        if ( rc == LDAP_SUCCESS ) {
                                if ( rs->sr_err == LDAP_SUCCESS ) {
@@ -177,12 +179,12 @@ retry:
        /* these have to be freed anyway... */
        if ( rs->sr_matched ) {
                free( (char *)rs->sr_matched );
+               rs->sr_matched = NULL;
        }
        if ( rs->sr_text ) {
                free( (char *)rs->sr_text );
+               rs->sr_text = NULL;
        }
-       rs->sr_matched = NULL;
-       rs->sr_text = NULL;
 
        if ( lc != NULL ) {
                ldap_back_release_conn( op, rs, lc );