diff options
author | Evan Huus <eapache@gmail.com> | 2013-09-15 20:18:56 +0000 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2013-09-15 20:18:56 +0000 |
commit | 432a064b0e341b4bf5aa78d8833005a40535be9d (patch) | |
tree | 30426944bc65499e7ccb16e4f5a293e124960ca8 /epan | |
parent | 82c63755abc4346e607ecb199915a6f3bc6c4d5b (diff) |
Simplification I noticed while reviewing the wmem conversion: there's no need to
strdup the string built in a strbuf if the scope is the same. Remove the
thoroughly unnecessary temporary variable as well.
svn path=/trunk/; revision=52082
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-radius.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/epan/dissectors/packet-radius.c b/epan/dissectors/packet-radius.c index 43e1c95611..f399291493 100644 --- a/epan/dissectors/packet-radius.c +++ b/epan/dissectors/packet-radius.c @@ -400,7 +400,6 @@ static const value_string ascenddf_proto[] = { {1, "icmp"}, {6, "tcp"}, {17 static const value_string ascenddf_portq[] = { {1, "lt"}, {2, "eq"}, {3, "gt"}, {4, "ne"}, {0, NULL} }; static const gchar *dissect_ascend_data_filter(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo _U_) { - const gchar *str; wmem_strbuf_t *filterstr; int len; guint8 proto, srclen, dstlen; @@ -411,8 +410,7 @@ static const gchar *dissect_ascend_data_filter(proto_tree* tree, tvbuff_t* tvb, len=tvb_length(tvb); if (len != 24) { - str = wmem_strdup_printf(wmem_packet_scope(), "Wrong attribute length %d", len); - return str; + return wmem_strdup_printf(wmem_packet_scope(), "Wrong attribute length %d", len); } filterstr=wmem_strbuf_sized_new(wmem_packet_scope(), 64, 64); @@ -426,8 +424,8 @@ static const gchar *dissect_ascend_data_filter(proto_tree* tree, tvbuff_t* tvb, proto=tvb_get_guint8(tvb, 14); if (proto) { - str=val_to_str(proto, ascenddf_proto, "%u"); - wmem_strbuf_append_printf(filterstr, " %s", str); + wmem_strbuf_append_printf(filterstr, " %s", + val_to_str(proto, ascenddf_proto, "%u")); } srcip=tvb_get_ipv4(tvb, 4); @@ -454,9 +452,7 @@ static const gchar *dissect_ascend_data_filter(proto_tree* tree, tvbuff_t* tvb, val_to_str(dstportq, ascenddf_portq, "%u"), dstport); } - str=wmem_strdup(wmem_packet_scope(), wmem_strbuf_get_str(filterstr)); - - return str; + return wmem_strbuf_get_str(filterstr); } static const gchar *dissect_framed_ipx_network(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo _U_) { |