]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#8866 (cont) slapo-unique
authorQuanah Gibson-Mount <quanah@openldap.org>
Fri, 26 Oct 2018 01:58:35 +0000 (01:58 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Fri, 26 Oct 2018 01:58:35 +0000 (01:58 +0000)
use correct memory allocation/free functions

servers/slapd/overlays/unique.c

index 41c698f475c60bc6e25ff5345f31448a7587ef26..8cc652daa85f0e99f5059362441fc574b606e892 100644 (file)
@@ -1012,11 +1012,11 @@ unique_search(
 
        if(uq.count) {
                errmsgsize = sizeof("non-unique attributes found with ") + key->bv_len;
-               errmsg = ch_malloc(errmsgsize);
+               errmsg = op->o_tmpalloc(errmsgsize, op->o_tmpmemctx);
                snprintf( errmsg, errmsgsize, "non-unique attributes found with %s", key->bv_val );
                op->o_bd->bd_info = (BackendInfo *) on->on_info;
                send_ldap_error(op, rs, LDAP_CONSTRAINT_VIOLATION, errmsg);
-               ch_free(errmsg);
+               op->o_tmpfree(errmsg, op->o_tmpmemctx);
                return(rs->sr_err);
        }