g_malloc0() doesn't return NULL so remove NULL error paths

svn path=/trunk/; revision=30274
This commit is contained in:
Kovarththanan Rajaratnam 2009-10-04 06:12:31 +00:00
parent 8805b149eb
commit 1703bfa464
1 changed files with 1 additions and 27 deletions

View File

@ -2881,10 +2881,6 @@ tvb_uncompress(tvbuff_t *tvb, int offset, int comprlen)
strm = g_malloc0(sizeof(z_stream));
if (strm == NULL) {
return NULL;
}
compr = tvb_memdup(tvb, offset, comprlen);
if (!compr) {
@ -2915,13 +2911,6 @@ tvb_uncompress(tvbuff_t *tvb, int offset, int comprlen)
strmbuf = g_malloc0(bufsiz);
if(strmbuf == NULL) {
g_free(compr);
g_free(strm);
return NULL;
}
strm->next_out = strmbuf;
strm->avail_out = bufsiz;
@ -2952,21 +2941,7 @@ tvb_uncompress(tvbuff_t *tvb, int offset, int comprlen)
if (uncompr == NULL) {
uncompr = g_memdup(strmbuf, bytes_pass);
} else {
guint8 *new_data = g_malloc0(bytes_out +
bytes_pass);
if (new_data == NULL) {
inflateEnd(strm);
g_free(strm);
g_free(strmbuf);
g_free(compr);
if (uncompr != NULL) {
g_free(uncompr);
}
return NULL;
}
guint8 *new_data = g_malloc0(bytes_out + bytes_pass);
g_memmove(new_data, uncompr, bytes_out);
g_memmove((new_data + bytes_out), strmbuf,
@ -3157,4 +3132,3 @@ tvbuff_t* tvb_child_uncompress(tvbuff_t *parent _U_, tvbuff_t *tvb, int offset,
return new_tvb;
}