From 9d528c111d789010977b1c4ca5148d537d7b6ba3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ond=C5=99ej=20Kuzn=C3=ADk?= Date: Fri, 2 Sep 2022 12:58:48 +0100 Subject: [PATCH] ITS#9817 One more leak plugged --- libraries/librewrite/escapemap.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libraries/librewrite/escapemap.c b/libraries/librewrite/escapemap.c index a28c888496..9a032dc4ef 100644 --- a/libraries/librewrite/escapemap.c +++ b/libraries/librewrite/escapemap.c @@ -54,7 +54,10 @@ map_unescape_filter( struct berval *input, struct berval *output ) } len = ldap_pvt_filter_value_unescape( output->bv_val ); - if ( len < 0 ) return REWRITE_ERR; + if ( len < 0 ) { + ber_memfree( output->bv_val ); + return REWRITE_ERR; + } output->bv_len = len; return LDAP_SUCCESS; @@ -194,7 +197,6 @@ map_escape_apply( int rc = fns[i]( &tmpin, &tmpout ); free( tmpin.bv_val ); if ( rc != REWRITE_SUCCESS ) { - free( tmpout.bv_val ); return rc; } tmpin = tmpout; -- 2.47.3