From: Pierangelo Masarati Date: Sat, 23 Sep 2006 15:43:55 +0000 (+0000) Subject: fix potential double free in case of error X-Git-Tag: OPENLDAP_REL_ENG_2_3_MP~102 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0d05846dc8837b23edf5944a2c74853b48335954;p=openldap fix potential double free in case of error --- diff --git a/libraries/librewrite/map.c b/libraries/librewrite/map.c index d82729f5ab..0abfd78b91 100644 --- a/libraries/librewrite/map.c +++ b/libraries/librewrite/map.c @@ -354,7 +354,12 @@ rewrite_map_apply( ( struct rewrite_context * )map->lm_data, key->bv_val, &val->bv_val ); if ( val->bv_val != NULL ) { - val->bv_len = strlen( val->bv_val ); + if ( val->bv_val = key->bv_val ) { + val->bv_len = key->bv_len; + key->bv_val = NULL; + } else { + val->bv_len = strlen( val->bv_val ); + } } break;