Delay allocation of z_stream

svn path=/trunk/; revision=30275
This commit is contained in:
Kovarththanan Rajaratnam 2009-10-04 06:20:32 +00:00
parent 1703bfa464
commit 19bf38ac52
1 changed files with 2 additions and 6 deletions

View File

@ -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;