diff options
Diffstat (limited to 'sys/lib')
-rw-r--r-- | sys/lib/libz/infblock.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/lib/libz/infblock.c b/sys/lib/libz/infblock.c index d3d3bb8e347..df9eb431f51 100644 --- a/sys/lib/libz/infblock.c +++ b/sys/lib/libz/infblock.c @@ -246,10 +246,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) + { + ZFREE(z, s->sub.trees.blens); s->mode = BAD; + } LEAVE } s->sub.trees.index = 0; @@ -310,11 +312,13 @@ 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) + { + ZFREE(z, s->sub.trees.blens); s->mode = BAD; + } r = t; LEAVE } @@ -326,6 +330,7 @@ int r; } s->sub.decode.codes = c; } + ZFREE(z, s->sub.trees.blens); s->mode = CODES; case CODES: UPDATE |