]> git.sur5r.net Git - openldap/commitdiff
don't leak entry/referrals in case of reference
authorPierangelo Masarati <ando@openldap.org>
Sun, 7 Aug 2005 21:26:15 +0000 (21:26 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sun, 7 Aug 2005 21:26:15 +0000 (21:26 +0000)
servers/slapd/back-sql/search.c

index d272ef724fbd760a13b68e91fb48e116a263729a..44b061777238892f449427af4bef90033241171c 100644 (file)
@@ -1843,6 +1843,10 @@ backsql_search( Operation *op, SlapReply *rs )
                        }
                        break;
                }
+
+               /* an entry was created; free it */
+               entry_clean( bsi.bsi_e );
+
                /* fall thru */
 
        default:
@@ -1863,8 +1867,13 @@ backsql_search( Operation *op, SlapReply *rs )
 #endif /* SLAP_ACL_HONOR_DISCLOSE */
 
                send_ldap_result( op, rs );
-               goto done;
 
+               if ( rs->sr_ref ) {
+                       ber_bvarray_free( rs->sr_ref );
+                       rs->sr_ref = NULL;
+               }
+
+               goto done;
        }
 #ifdef SLAP_ACL_HONOR_DISCLOSE
        /* NOTE: __NEW__ "search" access is required