aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris D. Faulhaber <jedgar@FreeBSD.org>2002-02-23 00:16:14 +0000
committerChris D. Faulhaber <jedgar@FreeBSD.org>2002-02-23 00:16:14 +0000
commitaa1fb18efb15339759dc35d845f8da5525f84275 (patch)
tree9ba412bcfa50e31acb70689ebd93cd398d8ff817
parentd921867039c986299a160ce51d8a6661670b3551 (diff)
downloadsrc-aa1fb18efb15339759dc35d845f8da5525f84275.tar.gz
src-aa1fb18efb15339759dc35d845f8da5525f84275.zip
MFC 1.11: Error handling fixes for inflate.
Notes
Notes: svn path=/releng/4.3/; revision=91092
-rw-r--r--sys/net/zlib.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/net/zlib.c b/sys/net/zlib.c
index 19df8590db24..bf1f72dae344 100644
--- a/sys/net/zlib.c
+++ b/sys/net/zlib.c
@@ -3864,10 +3864,11 @@ int r;
&s->sub.trees.tb, z);
if (t != Z_OK)
{
- ZFREE(z, s->sub.trees.blens);
r = t;
- if (r == Z_DATA_ERROR)
+ if (r == Z_DATA_ERROR) {
+ ZFREE(z, s->sub.trees.blens);
s->mode = BADB;
+ }
LEAVE
}
s->sub.trees.index = 0;
@@ -3932,11 +3933,12 @@ int r;
#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)
+ if (t == (uInt)Z_DATA_ERROR) {
+ ZFREE(z, s->sub.trees.blens);
s->mode = BADB;
+ }
r = t;
LEAVE
}
@@ -3953,6 +3955,7 @@ int r;
s->sub.decode.tl = tl;
s->sub.decode.td = td;
}
+ ZFREE(z, s->sub.trees.blens);
s->mode = CODES;
case CODES:
UPDATE