diff options
author | Guy Harris <guy@alum.mit.edu> | 2006-01-07 03:36:37 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2006-01-07 03:36:37 +0000 |
commit | 6f38a35500136bfdeede1f53bccc9a9902798263 (patch) | |
tree | 5f939d8818034b7719eaeb1e2b932c784e6509e0 /epan/tvbuff.c | |
parent | 15f905102907db3230fd7a5d46d7e336bc800235 (diff) | |
download | wireshark-6f38a35500136bfdeede1f53bccc9a9902798263.tar.gz |
Add some inflateEnd() calls to free up stuff associated with a stream
before freeing the stream; bug 659 mentioned one of them, but there
appear to be others.
svn path=/trunk/; revision=16973
Diffstat (limited to 'epan/tvbuff.c')
-rw-r--r-- | epan/tvbuff.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/epan/tvbuff.c b/epan/tvbuff.c index bcb298141d..a31584845c 100644 --- a/epan/tvbuff.c +++ b/epan/tvbuff.c @@ -2417,6 +2417,7 @@ tvb_uncompress(tvbuff_t *tvb, int offset, int comprlen) err = inflateInit2(strm, wbits); inits_done = 1; if (err != Z_OK) { + inflateEnd(strm); g_free(strm); g_free(compr); g_free(strmbuf); @@ -2444,6 +2445,7 @@ tvb_uncompress(tvbuff_t *tvb, int offset, int comprlen) bytes_pass); if (new_data == NULL) { + inflateEnd(strm); g_free(strm); g_free(strmbuf); g_free(compr); @@ -2477,7 +2479,7 @@ tvb_uncompress(tvbuff_t *tvb, int offset, int comprlen) * to decompress this fully, so return what we've done * so far, if any. */ - + inflateEnd(strm); g_free(strm); g_free(strmbuf); @@ -2511,6 +2513,7 @@ tvb_uncompress(tvbuff_t *tvb, int offset, int comprlen) if (*c == Z_DEFLATED) { c++; } else { + inflateEnd(strm); g_free(strm); g_free(compr); g_free(strmbuf); @@ -2555,6 +2558,7 @@ tvb_uncompress(tvbuff_t *tvb, int offset, int comprlen) next = c; strm->next_in = next; if (c - compr > comprlen) { + inflateEnd(strm); g_free(strm); g_free(compr); g_free(strmbuf); @@ -2562,6 +2566,7 @@ tvb_uncompress(tvbuff_t *tvb, int offset, int comprlen) } comprlen -= (c - compr); + inflateEnd(strm); err = inflateInit2(strm, wbits); inits_done++; } else if (err == Z_DATA_ERROR && uncompr == NULL && @@ -2598,6 +2603,7 @@ tvb_uncompress(tvbuff_t *tvb, int offset, int comprlen) return NULL; } } else { + inflateEnd(strm); g_free(strm); g_free(strmbuf); g_free(compr); |