From 1703bfa46406f2a03fefcad3d6ddb5abed19ddaa Mon Sep 17 00:00:00 2001 From: Kovarththanan Rajaratnam Date: Sun, 4 Oct 2009 06:12:31 +0000 Subject: [PATCH] g_malloc0() doesn't return NULL so remove NULL error paths svn path=/trunk/; revision=30274 --- epan/tvbuff.c | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/epan/tvbuff.c b/epan/tvbuff.c index 4661a2d6ca..e16179bc09 100644 --- a/epan/tvbuff.c +++ b/epan/tvbuff.c @@ -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; } -