]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-bdb/attr.c
Merge remote-tracking branch 'origin/mdb.RE/0.9'
[openldap] / servers / slapd / back-bdb / attr.c
index 2f183b3bf37f4b48d92bf04f0ad0ebd8a6bf039f..1ed6399fc0a43c19ab5e3d4e157e37eb39ac5447 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2000-2014 The OpenLDAP Foundation.
+ * Copyright 2000-2017 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -212,6 +212,10 @@ bdb_attr_index_config(
                                fprintf( stderr, "%s: line %d: %s\n",
                                        fname, lineno, c_reply->msg );
                        }
+fail:
+#ifdef LDAP_COMP_MATCH
+                       ch_free( cr );
+#endif
                        goto done;
                }
 
@@ -223,7 +227,7 @@ bdb_attr_index_config(
                                        fname, lineno, c_reply->msg );
                        }
                        rc = LDAP_UNWILLING_TO_PERFORM;
-                       goto done;
+                       goto fail;
                }
 
                if( IS_SLAP_INDEX( mask, SLAP_INDEX_APPROX ) && !(
@@ -238,7 +242,7 @@ bdb_attr_index_config(
                                        fname, lineno, c_reply->msg );
                        }
                        rc = LDAP_INAPPROPRIATE_MATCHING;
-                       goto done;
+                       goto fail;
                }
 
                if( IS_SLAP_INDEX( mask, SLAP_INDEX_EQUALITY ) && !(
@@ -253,7 +257,7 @@ bdb_attr_index_config(
                                        fname, lineno, c_reply->msg );
                        }
                        rc = LDAP_INAPPROPRIATE_MATCHING;
-                       goto done;
+                       goto fail;
                }
 
                if( IS_SLAP_INDEX( mask, SLAP_INDEX_SUBSTR ) && !(
@@ -268,7 +272,7 @@ bdb_attr_index_config(
                                        fname, lineno, c_reply->msg );
                        }
                        rc = LDAP_INAPPROPRIATE_MATCHING;
-                       goto done;
+                       goto fail;
                }
 
                Debug( LDAP_DEBUG_CONFIG, "index %s 0x%04lx\n",
@@ -298,11 +302,12 @@ bdb_attr_index_config(
                                 * just add the extracted component reference
                                 * in the AttrInfo
                                 */
+                               ch_free( a );
                                rc = insert_component_reference( cr, &a_cr->ai_cr );
                                if ( rc != LDAP_SUCCESS) {
                                        fprintf( stderr, " error during inserting component reference in %s ", attrs[i]);
                                        rc = LDAP_PARAM_ERROR;
-                                       goto done;
+                                       goto fail;
                                }
                                continue;
                        } else {
@@ -310,7 +315,8 @@ bdb_attr_index_config(
                                if ( rc != LDAP_SUCCESS) {
                                        fprintf( stderr, " error during inserting component reference in %s ", attrs[i]);
                                        rc = LDAP_PARAM_ERROR;
-                                       goto done;
+                                       ch_free( a );
+                                       goto fail;
                                }
                        }
                }