]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/component.c
check consistency of referrals and result code (ITS#4861)
[openldap] / servers / slapd / component.c
index 0b6cb2d51979ee6006437ac1ce26f16706dc11f7..95413c30a2afac8b430c81cefa64c9c2e6836577 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2003-2006 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;
                }
        }
@@ -1068,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 ) {