Cleanup: g_malloc can't return NULL, remove checks for them.
authordarkjames <darkjames@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 4 May 2011 21:19:04 +0000 (21:19 +0000)
committerdarkjames <darkjames@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 4 May 2011 21:19:04 +0000 (21:19 +0000)
XXX, should this code use g_try_malloc instead?

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

epan/dissectors/packet-iwarp-mpa.c
epan/dissectors/packet-spnego.c
epan/dissectors/packet-ssl-utils.c
tap-iostat.c

index 45ab48d372820d1d976554be7ee66f5fcbd9beaa..ec85288d90cb0b70abf31c7066f7abfb3fe3ec7c 100644 (file)
@@ -310,9 +310,6 @@ remove_markers(tvbuff_t *tvb, packet_info *pinfo, guint32 marker_offset,
        mfree_buff_length = orig_length - (MPA_MARKER_LEN * num_markers);
        mfree_buff = g_malloc(mfree_buff_length);
 
-       if (!mfree_buff)
-               THROW(OutOfMemoryError);
-
        tot_copy = 0;
        source_offset = 0;
        cur_copy = marker_offset;
index 3033b17c41e451793311b732543dddde63d6714f..37c7c90dce6fd46962c061f98aa7017d3d1ff796 100644 (file)
@@ -1141,8 +1141,6 @@ rrc_rotate(void *data, int len, guint16 rrc, int unrotate)
                tmp = buf;
        } else {
                tmp = g_malloc(rrc);
-               if (tmp == NULL)
-                       return -1;
        }
 
        if (unrotate) {
index 9bca0c3ed2c700d34454f9d8c34d739b9f766454..794e3b710f4c37b28649d8037e29e9fedeab267e 100644 (file)
@@ -1764,10 +1764,6 @@ ssl_generate_keyring_material(SslDecryptSession*ssl_session)
 
     key_block.data_len = needed;
     key_block.data = g_malloc(needed);
-    if (!key_block.data) {
-        ssl_debug_printf("ssl_generate_keyring_material can't allocate key_block (len %d)\n", needed);
-        return -1;
-    }
     ssl_debug_printf("ssl_generate_keyring_material sess key generation\n");
     if (PRF(ssl_session,&ssl_session->master_secret,"key expansion",
             &ssl_session->server_random,&ssl_session->client_random,
index e5b354d5b10a77b15a1968b8f9b6477f576001da..b718cace1b1a1706cd9f6813cc92d92248e88f76 100644 (file)
@@ -559,10 +559,6 @@ register_io_tap(io_stat_t *io, int i, const char *filter)
                                exit(10);
                        }
                        field=g_malloc(parenp-p+1);
-                       if(!field){
-                               fprintf(stderr, "tshark: Out of memory.\n");
-                               exit(10);
-                       }
                        memcpy(field, p, parenp-p);
                        field[parenp-p] = '\0';
                        flt=parenp + 1;