]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9817 One more leak plugged
authorOndřej Kuzník <ondra@mistotebe.net>
Fri, 2 Sep 2022 11:58:48 +0000 (12:58 +0100)
committerQuanah Gibson-Mount <quanah@openldap.org>
Mon, 12 Sep 2022 20:45:33 +0000 (20:45 +0000)
libraries/librewrite/escapemap.c

index a28c888496ceb7a285b88dd1e4629d6105add575..9a032dc4ef513d0645433acbbb9edc496bece984 100644 (file)
@@ -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;