From 382bb4de11bbe0dc8dc4506b82a8defe9722cce7 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Wed, 22 Oct 2008 21:58:59 +0000 Subject: [PATCH] save one copy (please review) --- servers/slapd/overlays/ppolicy.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/servers/slapd/overlays/ppolicy.c b/servers/slapd/overlays/ppolicy.c index ca0cb29b14..17f90fa17b 100644 --- a/servers/slapd/overlays/ppolicy.c +++ b/servers/slapd/overlays/ppolicy.c @@ -395,17 +395,16 @@ create_passcontrol( Operation *op, int exptime, int grace, LDAPPasswordPolicyErr } ber_printf( ber, /*{*/ "N}" ); - if (ber_flatten2( ber, &(c.ldctl_value), 1 ) == -1) { + if (ber_flatten2( ber, &c.ldctl_value, 0 ) == -1) { return NULL; } - (void)ber_free_buf(ber); cp = op->o_tmpalloc( sizeof( LDAPControl ) + c.ldctl_value.bv_len, op->o_tmpmemctx ); cp->ldctl_oid = (char *)ppolicy_ctrl_oid; cp->ldctl_iscritical = 0; cp->ldctl_value.bv_val = (char *)&cp[1]; cp->ldctl_value.bv_len = c.ldctl_value.bv_len; AC_MEMCPY( cp->ldctl_value.bv_val, c.ldctl_value.bv_val, c.ldctl_value.bv_len ); - ber_memfree( c.ldctl_value.bv_val ); + (void)ber_free_buf(ber); return cp; } -- 2.39.5