From Chris Maynard: don't extract strings with "tvb_get_string()" if

we're not going to use them, and free them when we're done with them.

Clean up white space.

svn path=/trunk/; revision=12963
This commit is contained in:
Guy Harris 2005-01-05 10:51:05 +00:00
parent 45d7435bd3
commit 77762e2ddc
1 changed files with 8 additions and 6 deletions

View File

@ -878,12 +878,14 @@ dissect_sdp_media(tvbuff_t *tvb, proto_item *ti,
} else {
tokenlen = next_offset - offset;
}
media_format = tvb_get_string(tvb, offset, tokenlen);
if (!strcmp(transport_info->media_proto[transport_info->media_count], "RTP/AVP")) {
proto_tree_add_string(sdp_media_tree, hf_media_format, tvb,
offset, tokenlen, val_to_str(atol(media_format), rtp_payload_type_vals, "%u"));
} else {
if (strcmp(transport_info->media_proto[transport_info->media_count],
"RTP/AVP") == 0) {
media_format = tvb_get_string(tvb, offset, tokenlen);
proto_tree_add_string(sdp_media_tree, hf_media_format, tvb, offset,
tokenlen, val_to_str(atol(media_format), rtp_payload_type_vals, "%u"));
g_free(media_format);
} else {
proto_tree_add_item(sdp_media_tree, hf_media_format, tvb,
offset, tokenlen, FALSE);
}