aboutsummaryrefslogtreecommitdiffstats
path: root/asn1/snmp
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2006-07-04 03:27:14 +0000
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2006-07-04 03:27:14 +0000
commitb9ee7a9b4f583ed51fe7c0dd83d603d486f8d17b (patch)
tree6165a65167d7b8fa8c05a7eee0a8bd6c892c56ae /asn1/snmp
parent45cb7d3fab97605f15fb17b6db49968dd919c065 (diff)
replace the two remaining g_malloc with ep_alloc
this indirectly fixes a tiny memory leak with one of the g_mallocs svn path=/trunk/; revision=18649
Diffstat (limited to 'asn1/snmp')
-rw-r--r--asn1/snmp/packet-snmp-template.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/asn1/snmp/packet-snmp-template.c b/asn1/snmp/packet-snmp-template.c
index 07d777d928..f8a3a8aaf0 100644
--- a/asn1/snmp/packet-snmp-template.c
+++ b/asn1/snmp/packet-snmp-template.c
@@ -826,7 +826,7 @@ snmp_variable_decode(tvbuff_t *tvb, proto_tree *snmp_tree, packet_info *pinfo,tv
if (oid_tvb){
oid_len = tvb_length_remaining(oid_tvb,0);
var_oid_buf = tvb_get_ptr(oid_tvb, 0, oid_len);
- variable_oid = g_malloc((oid_len+1) * sizeof(gulong));
+ variable_oid = ep_alloc((oid_len+1) * sizeof(gulong));
variable_oid_length = oid_to_subid_buf(var_oid_buf, oid_len, variable_oid, ((oid_len+1) * sizeof(gulong)));
}
/* parse the value */
@@ -962,7 +962,7 @@ snmp_variable_decode(tvbuff_t *tvb, proto_tree *snmp_tree, packet_info *pinfo,tv
/* XXX Redo this using dissect_ber_object_identifier when
it returns tvb or some other binary form of an OID */
oid_buf = tvb_get_ptr(tvb, vb_value_start, vb_length);
- vb_oid = g_malloc((vb_length+1) * sizeof(gulong));
+ vb_oid = ep_alloc((vb_length+1) * sizeof(gulong));
vb_oid_length = oid_to_subid_buf(oid_buf, vb_length, vb_oid, ((vb_length+1) * sizeof(gulong)));
offset = offset + vb_length;
@@ -996,7 +996,6 @@ snmp_variable_decode(tvbuff_t *tvb, proto_tree *snmp_tree, packet_info *pinfo,tv
}
#endif /* HAVE_SOME_SNMP */
}
- g_free(vb_oid);
break;
case SNMP_NOSUCHOBJECT: