From: Martin Pool Date: Mon, 11 Mar 2002 05:55:33 +0000 (+0000) Subject: Merge zlib double-free bug forwarded by Mark J Cox. X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/567e56313a9c14e877814c1223f5dc8839dc95b3 Merge zlib double-free bug forwarded by Mark J Cox. --- diff --git a/zlib/infblock.c b/zlib/infblock.c index 1c221dda..58f0628c 100644 --- a/zlib/infblock.c +++ b/zlib/infblock.c @@ -249,10 +249,12 @@ int r; &s->sub.trees.tb, s->hufts, z); if (t != Z_OK) { - ZFREE(z, s->sub.trees.blens); r = t; if (r == Z_DATA_ERROR) - s->mode = zBAD; + { + ZFREE(z, s->sub.trees.blens); + s->mode = zBAD; + } LEAVE } s->sub.trees.index = 0; @@ -317,10 +319,14 @@ int r; if (t != Z_OK) { if (t == (uInt)Z_DATA_ERROR) - s->mode = zBAD; + { + ZFREE(z, s->sub.trees.blens); + s->mode = zBAD; + } r = t; LEAVE } + ZFREE(z, s->sub.trees.blens); Tracev((stderr, "inflate: trees ok\n")); if ((c = inflate_codes_new(bl, bd, tl, td, z)) == Z_NULL) {