From Evan Huus:

In dissect_sdp_media_attribute() we can leak 'key' in an error condition.
 Simply move the allocation to after the error check.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7231

svn path=/trunk/; revision=42456
This commit is contained in:
Bill Meier 2012-05-07 01:18:17 +00:00
parent 7582254ef1
commit 07d88fc044
1 changed files with 4 additions and 2 deletions

View File

@ -1595,12 +1595,14 @@ static void dissect_sdp_media_attribute(tvbuff_t *tvb, packet_info *pinfo, proto
proto_tree_add_item(sdp_media_attribute_tree, hf_media_encoding_name, tvb,
offset, tokenlen, ENC_ASCII|ENC_NA);
key=g_malloc( sizeof(gint) );
*key=atol((char*)payload_type);
pt = atoi((char*)payload_type);
if (pt >= SDP_NO_OF_PT) {
return; /* Invalid */
}
key = g_malloc( sizeof(gint) );
*key = atol((char*)payload_type);
transport_info->encoding_name[pt] = (char*)tvb_get_ephemeral_string(tvb, offset, tokenlen);
next_offset = next_offset + 1;