aboutsummaryrefslogtreecommitdiffstats
path: root/epan/tvbuff.c
diff options
context:
space:
mode:
authorKovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com>2009-10-04 06:20:32 +0000
committerKovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com>2009-10-04 06:20:32 +0000
commit19bf38ac52cece3b7d6879d10ad67ba812cb1c32 (patch)
tree329cc5c3188c4a5e2736768637b6c5537d5c42b2 /epan/tvbuff.c
parent1703bfa46406f2a03fefcad3d6ddb5abed19ddaa (diff)
Delay allocation of z_stream
svn path=/trunk/; revision=30275
Diffstat (limited to 'epan/tvbuff.c')
-rw-r--r--epan/tvbuff.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/epan/tvbuff.c b/epan/tvbuff.c
index e16179bc09..f2a861985a 100644
--- a/epan/tvbuff.c
+++ b/epan/tvbuff.c
@@ -2879,14 +2879,10 @@ tvb_uncompress(tvbuff_t *tvb, int offset, int comprlen)
return NULL;
}
- strm = g_malloc0(sizeof(z_stream));
-
compr = tvb_memdup(tvb, offset, comprlen);
- if (!compr) {
- g_free(strm);
+ if (!compr)
return NULL;
- }
/*
* Assume that the uncompressed data is at least twice as big as
@@ -2906,10 +2902,10 @@ tvb_uncompress(tvbuff_t *tvb, int offset, int comprlen)
next = compr;
+ strm = g_malloc0(sizeof(z_stream));
strm->next_in = next;
strm->avail_in = comprlen;
-
strmbuf = g_malloc0(bufsiz);
strm->next_out = strmbuf;
strm->avail_out = bufsiz;