diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2005-08-15 12:04:15 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2005-08-15 12:04:15 +0000 |
commit | 12e2db899c40754f1614273fe832b33803aefce9 (patch) | |
tree | 3520a81985994c92826a1ec160fd7bd5bceef8ab /epan | |
parent | 6a87b85451d5f78e90f653a0f9434c98aa6c5f2a (diff) |
ememify g_malloc() calls
svn path=/trunk/; revision=15357
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-icep.c | 7 | ||||
-rw-r--r-- | epan/dissectors/packet-icmpv6.c | 4 |
2 files changed, 5 insertions, 6 deletions
diff --git a/epan/dissectors/packet-icep.c b/epan/dissectors/packet-icep.c index b0763035d6..87838fdd28 100644 --- a/epan/dissectors/packet-icep.c +++ b/epan/dissectors/packet-icep.c @@ -54,6 +54,7 @@ #include <epan/packet.h> #include <epan/dissectors/packet-tcp.h> +#include <epan/emem.h> #if 0 #define DBG(str, args...) do {\ @@ -326,12 +327,11 @@ static void dissect_ice_facet(proto_tree *tree, int hf_icep, if ( Size == 0 ) { if (tree) { - s = g_malloc( strlen("(empty)") + 1 ); + s = ep_alloc( strlen("(empty)") + 1 ); sprintf(s, "(empty)"); s[strlen("(empty)")] = '\0'; /* display the 0x00 Size byte when click on a empty ice_string */ proto_tree_add_string(tree, hf_icep, tvb, offset - 1, 1, s); - g_free(s); } return; } @@ -453,13 +453,12 @@ static void dissect_ice_context(proto_tree *tree, tvbuff_t *tvb, guint32 offset, } if (Size == 0) { - s = g_malloc( strlen("(empty)") + 1 ); + s = ep_alloc( strlen("(empty)") + 1 ); sprintf(s, "(empty)"); s[strlen("(empty)")] = '\0'; /* display the 0x00 Size byte when click on a empty context */ if (tree) proto_tree_add_string(tree, hf_icep_context, tvb, offset - 1, 1, s); - g_free(s); return; } diff --git a/epan/dissectors/packet-icmpv6.c b/epan/dissectors/packet-icmpv6.c index f5c02d8059..e9a23588a1 100644 --- a/epan/dissectors/packet-icmpv6.c +++ b/epan/dissectors/packet-icmpv6.c @@ -51,6 +51,7 @@ #include <epan/in_cksum.h> #include <epan/addr_resolv.h> #include <epan/ipproto.h> +#include <epan/emem.h> #ifndef offsetof #define offsetof(type, member) ((size_t)(&((type *)0)->member)) @@ -224,7 +225,7 @@ again: p = offset + sizeof(*opt); len = (opt->nd_opt_len << 3) - sizeof(*opt); a = tvb_get_ptr(tvb, p, len); - t = g_malloc(len * 3); + t = ep_alloc(len * 3); memset(t, 0, len * 3); for (i = 0; i < len; i++) { if (i) @@ -233,7 +234,6 @@ again: } proto_tree_add_text(icmp6opt_tree, tvb, offset + sizeof(*opt), len, "Link-layer address: %s", t); - g_free(t); break; } case ND_OPT_PREFIX_INFORMATION: |