]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/component.c
Added a new parameter (ConfigArgs*) to the _db_init, _db_open, _db_close and
[openldap] / servers / slapd / component.c
index 01c30d67ca64a53724c04dda507a1560964e5529..95413c30a2afac8b430c81cefa64c9c2e6836577 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2003-2005 The OpenLDAP Foundation.
+ * Copyright 2003-2007 The OpenLDAP Foundation.
  * Portions Copyright 2004 by IBM Corporation.
  * All rights reserved.
  *
@@ -179,7 +179,7 @@ dup_comp_ref ( Operation* op, ComponentReference* cr )
                ci_curr = ci_curr->ci_next, ci_temp = &(*ci_temp)->ci_next )
        {
                *ci_temp = op->o_tmpalloc( sizeof( ComponentId ), op->o_tmpmemctx );
-               if ( !ci_temp ) return NULL;
+               if ( !*ci_temp ) return NULL;
                **ci_temp = *ci_curr;
        }
 
@@ -580,6 +580,11 @@ get_component_reference(
                        cr_list = &(*cr_list)->ci_next;
 
                } else if ( rc == LDAP_COMPREF_UNDEFINED ) {
+                       if ( op ) {
+                               op->o_tmpfree( ca_comp_ref , op->o_tmpmemctx );
+                       } else {
+                               free( ca_comp_ref );
+                       }
                        return rc;
                }
        }
@@ -594,16 +599,8 @@ get_component_reference(
                return rc;
        }
 
-       if ( rc == LDAP_SUCCESS ) {     
-               *cr = ca_comp_ref;
-               **cr = *ca_comp_ref;    
-
-       } else if ( op ) {
-                op->o_tmpfree( ca_comp_ref , op->o_tmpmemctx );
-
-       } else {
-                free( ca_comp_ref ) ;
-       }
+       *cr = ca_comp_ref;
+       **cr = *ca_comp_ref;    
 
        (*cr)->cr_string.bv_val = start;
        (*cr)->cr_string.bv_len = end - start + 1;
@@ -1076,7 +1073,7 @@ parse_comp_filter( Operation* op, ComponentAssertionValue* cav,
        ber_tag_t       tag;
        int             err;
        ComponentFilter f;
-       /* TAG : item, and, or, not in RFC 2254 */
+       /* TAG : item, and, or, not in RFC 4515 */
        tag = strip_cav_tag( cav );
 
        if ( tag == LBER_ERROR ) {