forked from osmocom/wireshark
Cleanup: g_malloc can't return NULL, remove checks for them.
XXX, should this code use g_try_malloc instead? svn path=/trunk/; revision=36988
This commit is contained in:
parent
669162b440
commit
d621e6acbe
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue