]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/syntax.c
ITS#8789 avoid unnecessary writes of context entry
[openldap] / servers / slapd / syntax.c
index 004499deab03ade4ac767574010ee23e5dfde97f..38822b4beb2bc5a83c671292766c63d0763a3763 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2014 The OpenLDAP Foundation.
+ * Copyright 1998-2017 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -224,6 +224,7 @@ syn_add(
                        {
                                Debug( LDAP_DEBUG_ANY, "syn_add(%s): exactly one substitute syntax must be present\n",
                                        ssyn->ssyn_syn.syn_oid, 0, 0 );
+                               SLAP_FREE( ssyn );
                                return SLAP_SCHERR_SYN_SUBST_NOT_SPECIFIED;
                        }
 
@@ -231,6 +232,7 @@ syn_add(
                        if ( subst == NULL ) {
                                Debug( LDAP_DEBUG_ANY, "syn_add(%s): substitute syntax %s not found\n",
                                        ssyn->ssyn_syn.syn_oid, (*lsei)->lsei_values[0], 0 );
+                               SLAP_FREE( ssyn );
                                return SLAP_SCHERR_SYN_SUBST_NOT_FOUND;
                        }
                        break;