aboutsummaryrefslogtreecommitdiffstats
path: root/epan/addr_resolv.c
diff options
context:
space:
mode:
authorHadriel Kaplan <hadriel@128technology.com>2014-12-29 00:21:15 -0500
committerMichael Mann <mmann78@netscape.net>2015-01-04 21:02:38 +0000
commitfac8356610fadf488ff92c5a22e5177bb33a2511 (patch)
treeaf8a1ceec7eb91c5a6a5e6e2ac14621425125e65 /epan/addr_resolv.c
parent5653fcedca8491829d6d6ce480e7fba13ff801d7 (diff)
Make all Lua code use wmem not emem
Changed all remaining code in wslua that was using emem, to use wmem or simpler methods. Bug: 9927 Change-Id: I3d19a770e0fd77d996bdb6b61a76a722cc2bcd55 Reviewed-on: https://code.wireshark.org/review/6109 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/addr_resolv.c')
-rw-r--r--epan/addr_resolv.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/epan/addr_resolv.c b/epan/addr_resolv.c
index 7a8d5b30bc..f78b6f7044 100644
--- a/epan/addr_resolv.c
+++ b/epan/addr_resolv.c
@@ -2903,6 +2903,28 @@ ep_address_to_display(const address *addr)
}
const gchar *
+wmem_address_to_display(wmem_allocator_t *allocator, const address *addr)
+{
+ gchar *str = NULL;
+ const gchar *result = solve_address_to_name(addr);
+
+ if (result != NULL) {
+ /* unlike ep_address_to_display(), we can't assume the lifetime of the address' members
+ is safe, so we allocate and copy */
+ str = wmem_strdup(allocator, result);
+ }
+ else if (addr->type == AT_NONE) {
+ str = wmem_strdup(allocator, "NONE");
+ }
+ else {
+ str = (gchar *) wmem_alloc(allocator, MAX_ADDR_STR_LEN);
+ address_to_str_buf(addr, str, MAX_ADDR_STR_LEN);
+ }
+
+ return str;
+}
+
+const gchar *
get_addr_name(const address *addr)
{
guint32 ip4_addr;