summaryrefslogtreecommitdiff
path: root/asn1/snmp
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2015-01-17 14:11:29 -0500
committerMichael Mann <mmann78@netscape.net>2015-01-19 02:52:11 +0000
commite333e4c90f0aca41b0a56cef22fd80d0b0e73e14 (patch)
tree0d90a0e8561d6e4cf1361d56629e649af655d40d /asn1/snmp
parent59155d1d1c40a979d5f5040e4df35ee72dadbb9c (diff)
downloadwireshark-e333e4c90f0aca41b0a56cef22fd80d0b0e73e14.tar.gz
Convert OID APIs to use wmem.
There are a few oid functions that are only called in oids_test.c. I'll presume the APIs are used in proprietary dissectors rather than just remove them. Change-Id: I4595e00f93bf9ab8cf2493fe0432b91960f55a3f Reviewed-on: https://code.wireshark.org/review/6592 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Guy Harris <guy@alum.mit.edu> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'asn1/snmp')
-rw-r--r--asn1/snmp/packet-snmp-template.c16
-rw-r--r--asn1/snmp/snmp.cnf2
2 files changed, 9 insertions, 9 deletions
diff --git a/asn1/snmp/packet-snmp-template.c b/asn1/snmp/packet-snmp-template.c
index cfeafd8d23..222ffc3ead 100644
--- a/asn1/snmp/packet-snmp-template.c
+++ b/asn1/snmp/packet-snmp-template.c
@@ -607,21 +607,21 @@ dissect_snmp_VarBind(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset,
/* fetch ObjectName and its relative oid_info */
oid_bytes = (guint8*)tvb_memdup(wmem_packet_scope(), tvb, name_offset, name_len);
- oid_info = oid_get_from_encoded(oid_bytes, name_len, &subids, &oid_matched, &oid_left);
+ oid_info = oid_get_from_encoded(wmem_packet_scope(), oid_bytes, name_len, &subids, &oid_matched, &oid_left);
add_oid_debug_subtree(oid_info,pt_name);
if (!subids) {
proto_item* pi;
- repr = oid_encoded2string(oid_bytes, name_len);
+ repr = oid_encoded2string(wmem_packet_scope(), oid_bytes, name_len);
pt = proto_tree_add_subtree_format(pt_name,tvb, 0, 0, ett_decoding_error, &pi, "invalid oid: %s", repr);
expert_add_info_format(actx->pinfo, pi, &ei_snmp_invalid_oid, "invalid oid: %s", repr);
return dissect_unknown_ber(actx->pinfo, tvb, name_offset, pt);
}
if (oid_matched+oid_left) {
- oid_string = oid_subid2string(subids,oid_matched+oid_left);
+ oid_string = oid_subid2string(wmem_packet_scope(), subids,oid_matched+oid_left);
}
if (ber_class == BER_CLASS_CON) {
@@ -752,7 +752,7 @@ show_oid_index:
goto indexing_done;
}
- suboid_buf_len = oid_subid2encoded(suboid_len, suboid, &suboid_buf);
+ suboid_buf_len = oid_subid2encoded(wmem_packet_scope(), suboid_len, suboid, &suboid_buf);
DISSECTOR_ASSERT(suboid_buf_len);
@@ -1020,13 +1020,13 @@ set_label:
if (oid_info && oid_info->name) {
if (oid_left >= 1) {
repr = wmem_strdup_printf(wmem_packet_scope(), "%s.%s (%s)", oid_info->name,
- oid_subid2string(&(subids[oid_matched]),oid_left),
- oid_subid2string(subids,oid_matched+oid_left));
+ oid_subid2string(wmem_packet_scope(), &(subids[oid_matched]),oid_left),
+ oid_subid2string(wmem_packet_scope(), subids,oid_matched+oid_left));
info_oid = wmem_strdup_printf(wmem_packet_scope(), "%s.%s", oid_info->name,
- oid_subid2string(&(subids[oid_matched]),oid_left));
+ oid_subid2string(wmem_packet_scope(), &(subids[oid_matched]),oid_left));
} else {
repr = wmem_strdup_printf(wmem_packet_scope(), "%s (%s)", oid_info->name,
- oid_subid2string(subids,oid_matched));
+ oid_subid2string(wmem_packet_scope(), subids,oid_matched));
info_oid = oid_info->name;
}
} else if (oid_string) {
diff --git a/asn1/snmp/snmp.cnf b/asn1/snmp/snmp.cnf
index 22e1ac3150..715a1b6934 100644
--- a/asn1/snmp/snmp.cnf
+++ b/asn1/snmp/snmp.cnf
@@ -70,7 +70,7 @@ gint pdu_type=-1;
%(DEFAULT_BODY)s
if (display_oid && enterprise_oid) {
- name = oid_resolved_from_string(enterprise_oid);
+ name = oid_resolved_from_string(wmem_packet_scope(), enterprise_oid);
if (name) {
col_append_fstr (actx->pinfo->cinfo, COL_INFO, " %%s", name);
}