]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/overlays/dynlist.c
ITS#8063 more for prev commit
[openldap] / servers / slapd / overlays / dynlist.c
index 0b7f994555d8ea2929e11560db81a0366a4a655d..968fbb0a592565f9613e1c0437467774e8366e74 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2003-2013 The OpenLDAP Foundation.
+ * Copyright 2003-2015 The OpenLDAP Foundation.
  * Portions Copyright 2004-2005 Pierangelo Masarati.
  * Portions Copyright 2008 Emmanuel Dreyfus.
  * All rights reserved.
@@ -1158,6 +1158,12 @@ done_uri:;
                                        filter_free( filter );
                                }
 
+                               while ( dlm != NULL ) {
+                                       dlml = dlm;
+                                       dlm = dlm->dlm_next;
+                                       ch_free( dlml );
+                               }
+
                                Debug( LDAP_DEBUG_ANY, "%s: %s.\n",
                                        c->log, c->cr_msg, 0 );
 
@@ -1174,7 +1180,8 @@ done_uri:;
                                c->argv[ attridx ] );
                        Debug( LDAP_DEBUG_ANY, "%s: %s.\n",
                                c->log, c->cr_msg, 0 );
-                       return 1;
+                       rc = 1;
+                       goto done_uri;
                }
 
                if ( !is_at_subtype( ad->ad_type, slap_schema.si_ad_labeledURI->ad_type ) ) {
@@ -1184,7 +1191,8 @@ done_uri:;
                                c->argv[ attridx ] );
                        Debug( LDAP_DEBUG_ANY, "%s: %s.\n",
                                c->log, c->cr_msg, 0 );
-                       return 1;
+                       rc = 1;
+                       goto done_uri;
                }
 
                attridx++;
@@ -1213,7 +1221,8 @@ done_uri:;
                                                i - 3, c->argv[ i ] );
                                        Debug( LDAP_DEBUG_ANY, "%s: %s.\n",
                                                c->log, c->cr_msg, 0 );
-                                       return 1;
+                                       rc = 1;
+                                       goto done_uri;
                                }
                                arg = cp + 1;
                        }
@@ -1226,7 +1235,8 @@ done_uri:;
                                        i - 3, c->argv[ i ] );
                                Debug( LDAP_DEBUG_ANY, "%s: %s.\n",
                                        c->log, c->cr_msg, 0 );
-                               return 1;
+                               rc = 1;
+                               goto done_uri;
                        }
 
                        dlmp = (dynlist_map_t *)ch_calloc( 1, sizeof( dynlist_map_t ) );
@@ -1255,7 +1265,8 @@ done_uri:;
                                                c->valx );
                                        Debug( LDAP_DEBUG_ANY, "%s: %s.\n",
                                                c->log, c->cr_msg, 0 );
-                                       return 1;
+                                       rc = 1;
+                                       goto done_uri;
                                }
                                dlip = &(*dlip)->dli_next;
                        }