]> git.sur5r.net Git - openldap/commitdiff
Fix *=+=* bug.
authorKurt Zeilenga <kurt@openldap.org>
Sat, 28 Aug 1999 06:15:43 +0000 (06:15 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sat, 28 Aug 1999 06:15:43 +0000 (06:15 +0000)
Plug leak of ber.

CHANGES
servers/slapd/filterentry.c
servers/slapd/result.c

diff --git a/CHANGES b/CHANGES
index 9d2c544c8565dbb8ea81806239c602bcc3ae0e3e..108b926aa44fdc69d34cd9bffc20b145cd6793d1 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -8,6 +8,7 @@ Changes included in OpenLDAP 1.2 Release Engineering
        Fixed slapd memory leaks (ITS#249 ITS#250)
        Fixed test005-modrdn to properly report failure in delete rdn case 
        Fixed ldapsearch (%s) bug (ITS#274)
+       Fixed slapd (cn=*=+=*) regex bug (ITS#272)
        Build environment
                Disable config.cache to ensure consistent detection
        Documentation
index a6528b2877bc4a11841dc6aa5c258c9ee51d6aa9..4afa5ed4d28e30ebd572db9856db77e73e5707f7 100644 (file)
@@ -288,7 +288,6 @@ strcpy_special( char *d, char *s )
                case '[':
                case ']':
                case '*':
-               case '+':
                case '^':
                case '$':
                        *d++ = '\\';
@@ -386,7 +385,7 @@ test_substring_filter(
        /* compile the regex */
        Debug( LDAP_DEBUG_FILTER, "test_substring_filter: regcomp pat: %s\n",
                pat, 0, 0 );
-       if ((rc = regcomp(&re, pat, 0))) {
+       if ((rc = regcomp(&re, pat, REG_NOSUB))) {
                char error[512];
 
                regerror(rc, &re, error, sizeof(error));
index 4871d23ced86e48b139365bf4f4bf1e9807a1684..19d162ed53069f2367fbd57b512facd5a43ace37 100644 (file)
@@ -79,6 +79,7 @@ send_ldap_result2(
 
        if ( rc == -1 ) {
                Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 );
+               ber_free( ber, 1 );
                return;
        }
 
@@ -89,7 +90,7 @@ send_ldap_result2(
        bytes = ber->ber_ptr - ber->ber_buf;
        ldap_pvt_thread_mutex_lock( &new_conn_mutex );
        while ( conn->c_connid == op->o_connid && ber_flush( &conn->c_sb, ber,
-           1 ) != 0 ) {
+           0 ) != 0 ) {
                ldap_pvt_thread_mutex_unlock( &new_conn_mutex );
                /*
                 * we got an error.  if it's ewouldblock, we need to
@@ -105,6 +106,7 @@ send_ldap_result2(
                        close_connection( conn, op->o_connid, op->o_opid );
 
                        ldap_pvt_thread_mutex_unlock( &conn->c_pdumutex );
+                       ber_free( ber, 1 );
                        return;
                }
 
@@ -128,6 +130,8 @@ send_ldap_result2(
        ldap_pvt_thread_mutex_unlock( &new_conn_mutex );
        ldap_pvt_thread_mutex_unlock( &conn->c_pdumutex );
 
+       ber_free( ber, 1 );
+
        ldap_pvt_thread_mutex_lock( &num_sent_mutex );
        num_bytes_sent += bytes;
        ldap_pvt_thread_mutex_unlock( &num_sent_mutex );
@@ -327,7 +331,7 @@ send_search_entry(
        bytes = ber->ber_ptr - ber->ber_buf;
        ldap_pvt_thread_mutex_lock( &new_conn_mutex );
        while ( conn->c_connid == op->o_connid && ber_flush( &conn->c_sb, ber,
-           1 ) != 0 ) {
+           0 ) != 0 ) {
                ldap_pvt_thread_mutex_unlock( &new_conn_mutex );
                /*
                 * we got an error.  if it's ewouldblock, we need to
@@ -343,6 +347,7 @@ send_search_entry(
                        close_connection( conn, op->o_connid, op->o_opid );
 
                        ldap_pvt_thread_mutex_unlock( &conn->c_pdumutex );
+                       ber_free( ber, 1 );
                        return( -1 );
                }
 
@@ -364,6 +369,8 @@ send_search_entry(
        ldap_pvt_thread_mutex_unlock( &new_conn_mutex );
        ldap_pvt_thread_mutex_unlock( &conn->c_pdumutex );
 
+       ber_free( ber, 1 );
+
        ldap_pvt_thread_mutex_lock( &num_sent_mutex );
        num_bytes_sent += bytes;
        num_entries_sent++;