From: Howard Chu Date: Thu, 29 Sep 2022 15:02:57 +0000 (+0100) Subject: ITS#9924 slapo-deref: plug memleak X-Git-Tag: OPENLDAP_REL_ENG_2_5_14~80 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f99099c1e31e71f685ff88bf1bae46f83977a35;p=thirdparty%2Fopenldap.git ITS#9924 slapo-deref: plug memleak memory alloc'd by bvarray_dup must be freed by bvarray_free, not regular free. --- diff --git a/servers/slapd/overlays/deref.c b/servers/slapd/overlays/deref.c index 89dc227f3e..93b7f69da8 100644 --- a/servers/slapd/overlays/deref.c +++ b/servers/slapd/overlays/deref.c @@ -439,7 +439,7 @@ deref_response( Operation *op, SlapReply *rs ) rc = ber_printf( ber, "{O[W]}", &dr->dr_spec.ds_attributes[ j ]->ad_cname, dr->dr_vals[ i ].dv_attrVals[ j ] ); - op->o_tmpfree( dr->dr_vals[ i ].dv_attrVals[ j ], + ber_bvarray_free_x( dr->dr_vals[ i ].dv_attrVals[ j ], op->o_tmpmemctx ); } }