X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/06b91d8eb97dd7ba1fa8af3f58e5aee28d831b3f..d5c973ccb7da1bc87c5caa5d5ac594bc217016f7:/zlib/infblock.c diff --git a/zlib/infblock.c b/zlib/infblock.c index 1c221dda..96a7a265 100644 --- a/zlib/infblock.c +++ b/zlib/infblock.c @@ -1,5 +1,5 @@ /* infblock.c -- interpret and process block types to last block - * Copyright (C) 1995-1998 Mark Adler + * Copyright (C) 1995-2002 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -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; @@ -313,14 +315,17 @@ int r; t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f), s->sub.trees.blens, &bl, &bd, &tl, &td, s->hufts, z); - ZFREE(z, s->sub.trees.blens); 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) {