From: Ondřej Kuzník Date: Fri, 2 Sep 2022 11:58:48 +0000 (+0100) Subject: ITS#9817 One more leak plugged X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d528c111d789010977b1c4ca5148d537d7b6ba3;p=thirdparty%2Fopenldap.git ITS#9817 One more leak plugged --- 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;