aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-diameter.c
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2013-12-23 21:09:26 +0000
committerEvan Huus <eapache@gmail.com>2013-12-23 21:09:26 +0000
commitadff2b3b503cbd4ada5607b6feb29f7a88dbc77d (patch)
tree1db9263fcba221da45eb0187ef94e34966e085a4 /epan/dissectors/packet-diameter.c
parentb2e5e4a81a15ccced82c532a4e88f5ed44cb95b5 (diff)
Get rid of some useless intermediate ep-memory when building Diameter arrays.
svn path=/trunk/; revision=54421
Diffstat (limited to 'epan/dissectors/packet-diameter.c')
-rw-r--r--epan/dissectors/packet-diameter.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/epan/dissectors/packet-diameter.c b/epan/dissectors/packet-diameter.c
index f95dc4d6dd..03d00cf124 100644
--- a/epan/dissectors/packet-diameter.c
+++ b/epan/dissectors/packet-diameter.c
@@ -1283,13 +1283,13 @@ reginfo(int *hf_ptr, const char *name, const char *abbr, const char *desc,
guint32 mask)
{
hf_register_info hf = { hf_ptr, {
- name ? wmem_strdup(wmem_epan_scope(), name) : wmem_strdup(wmem_epan_scope(), abbr),
- wmem_strdup(wmem_epan_scope(), abbr),
+ name,
+ abbr,
ft,
base,
NULL,
mask,
- wmem_strdup(wmem_epan_scope(), desc),
+ desc,
HFILL }};
if (vs_ext) {
@@ -1374,20 +1374,20 @@ build_address_avp(const avp_type_t *type _U_, guint32 code,
basic_avp_reginfo(a, name, FT_BYTES, BASE_NONE, NULL);
- reginfo(&(t->hf_address_type), ep_strdup_printf("%s Address Family",name),
- alnumerize(ep_strdup_printf("diameter.%s.addr_family",name)),
+ reginfo(&(t->hf_address_type), wmem_strdup_printf(wmem_epan_scope(), "%s Address Family",name),
+ alnumerize(wmem_strdup_printf(wmem_epan_scope(), "diameter.%s.addr_family",name)),
NULL, FT_UINT16, (field_display_e)(BASE_DEC|BASE_EXT_STRING), &diameter_avp_data_addrfamily_vals_ext, 0);
- reginfo(&(t->hf_ipv4), ep_strdup_printf("%s Address",name),
- alnumerize(ep_strdup_printf("diameter.%s.IPv4",name)),
+ reginfo(&(t->hf_ipv4), wmem_strdup_printf(wmem_epan_scope(), "%s Address",name),
+ alnumerize(wmem_strdup_printf(wmem_epan_scope(), "diameter.%s.IPv4",name)),
NULL, FT_IPv4, BASE_NONE, NULL, 0);
- reginfo(&(t->hf_ipv6), ep_strdup_printf("%s Address",name),
- alnumerize(ep_strdup_printf("diameter.%s.IPv6",name)),
+ reginfo(&(t->hf_ipv6), wmem_strdup_printf(wmem_epan_scope(), "%s Address",name),
+ alnumerize(wmem_strdup_printf(wmem_epan_scope(), "diameter.%s.IPv6",name)),
NULL, FT_IPv6, BASE_NONE, NULL, 0);
- reginfo(&(t->hf_other), ep_strdup_printf("%s Address",name),
- alnumerize(ep_strdup_printf("diameter.%s.Bytes",name)),
+ reginfo(&(t->hf_other), wmem_strdup_printf(wmem_epan_scope(), "%s Address",name),
+ alnumerize(wmem_strdup_printf(wmem_epan_scope(), "diameter.%s.Bytes",name)),
NULL, FT_BYTES, BASE_NONE, NULL, 0);
g_ptr_array_add(build_dict.ett,ettp);
@@ -1553,7 +1553,7 @@ dictionary_load(void)
ddict_avp_t *a;
gboolean do_debug_parser = getenv("WIRESHARK_DEBUG_DIAM_DICT_PARSER") ? TRUE : FALSE;
gboolean do_dump_dict = getenv("WIRESHARK_DUMP_DIAM_DICT") ? TRUE : FALSE;
- char *dir = ep_strdup_printf("%s" G_DIR_SEPARATOR_S "diameter" G_DIR_SEPARATOR_S, get_datafile_dir());
+ char *dir;
const avp_type_t *type;
const avp_type_t *octetstring = &basic_types[0];
diam_avp_t *avp;
@@ -1585,7 +1585,9 @@ dictionary_load(void)
}
/* load the dictionary */
+ dir = g_strdup_printf("%s" G_DIR_SEPARATOR_S "diameter" G_DIR_SEPARATOR_S, get_datafile_dir());
d = ddict_scan(dir,"dictionary.xml",do_debug_parser);
+ g_free(dir);
if (d == NULL) {
return 0;
}