--- drivers/net/zlib.c.orig Tue Mar 12 10:15:16 2002 +++ drivers/net/zlib.c Tue Mar 12 10:29:28 2002 @@ -3860,10 +3860,12 @@ &s->sub.trees.tb, z); if (t != Z_OK) { - ZFREE(z, s->sub.trees.blens); r = t; if (r == Z_DATA_ERROR) + { s->mode = BADB; + ZFREE(z, s->sub.trees.blens); + } LEAVE } s->sub.trees.index = 0; @@ -3928,14 +3930,17 @@ #endif t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f), s->sub.trees.blens, &bl, &bd, &tl, &td, z); - ZFREE(z, s->sub.trees.blens); if (t != Z_OK) { if (t == (uInt)Z_DATA_ERROR) + { s->mode = BADB; + ZFREE(z, s->sub.trees.blens); + } r = t; LEAVE } + ZFREE(z, s->sub.trees.blens); Tracev((stderr, "inflate: trees ok, %d * %d bytes used\n", inflate_hufts, sizeof(inflate_huft))); if ((c = inflate_codes_new(bl, bd, tl, td, z)) == Z_NULL)