From Chris Maynard: free up the z_stream we've allocated before failure
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 5 Jan 2005 10:19:36 +0000 (10:19 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 5 Jan 2005 10:19:36 +0000 (10:19 +0000)
returns.  (The error returns shouldn't happen in practice, as the GLib
memory allocators never return a null pointer, they just abort the
program, but if we're going to be checking for failure and returning, we
should do the right thing anyway.)

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12957 f5534014-38df-0310-8fa8-9805f1628bb7

epan/tvbuff.c

index 7443859d971ce4a2a2782ab01c6f4d99cc0a92d0..11e029106b14a0074b90fddb865967e55212a3d2 100644 (file)
@@ -2228,6 +2228,7 @@ tvb_uncompress(tvbuff_t *tvb, int offset, int comprlen)
        compr = tvb_memdup(tvb, offset, comprlen);
 
        if (!compr) {
+               g_free(strm);
                return NULL;
        }
 
@@ -2257,6 +2258,7 @@ tvb_uncompress(tvbuff_t *tvb, int offset, int comprlen)
 
        if(strmbuf == NULL) {
                g_free(compr);
+               g_free(strm);
                return NULL;
        }