aboutsummaryrefslogtreecommitdiffstats
path: root/epan/addr_resolv.c
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2015-01-29 10:01:38 -0500
committerEvan Huus <eapache@gmail.com>2015-01-29 15:45:20 +0000
commit0137f9226a4ff1f75c5d8b83bf3a52243a44e088 (patch)
tree18e175378026be1462e19ada2ee755fedcf8ffee /epan/addr_resolv.c
parent25f1df445991870b32d81bd60e9fbdcf241bcf47 (diff)
addr_resolv: correctly scope returned memory
*_port_to_display functions take an allocator scope, so the memory they return must be allocated from that scope, which means we must strdup the result of serv_name_lookup. Bug: 10901 Change-Id: I337c8b6f9dfece966964c09023679b3e24648e48 Reviewed-on: https://code.wireshark.org/review/6842 Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Evan Huus <eapache@gmail.com>
Diffstat (limited to 'epan/addr_resolv.c')
-rw-r--r--epan/addr_resolv.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/epan/addr_resolv.c b/epan/addr_resolv.c
index b7ff553aab..c928bed707 100644
--- a/epan/addr_resolv.c
+++ b/epan/addr_resolv.c
@@ -2861,7 +2861,7 @@ udp_port_to_display(wmem_allocator_t *allocator, guint port)
return wmem_utoa(allocator, port);
}
- return serv_name_lookup(port, PT_UDP);
+ return wmem_strdup(allocator, serv_name_lookup(port, PT_UDP));
} /* udp_port_to_display */
@@ -2873,7 +2873,7 @@ dccp_port_to_display(wmem_allocator_t *allocator, guint port)
return wmem_utoa(allocator, port);
}
- return serv_name_lookup(port, PT_DCCP);
+ return wmem_strdup(allocator, serv_name_lookup(port, PT_DCCP));
} /* dccp_port_to_display */
@@ -2885,7 +2885,7 @@ tcp_port_to_display(wmem_allocator_t *allocator, guint port)
return wmem_utoa(allocator, port);
}
- return serv_name_lookup(port, PT_TCP);
+ return wmem_strdup(allocator, serv_name_lookup(port, PT_TCP));
} /* tcp_port_to_display */
@@ -2897,7 +2897,7 @@ sctp_port_to_display(wmem_allocator_t *allocator, guint port)
return wmem_utoa(allocator, port);
}
- return serv_name_lookup(port, PT_SCTP);
+ return wmem_strdup(allocator, serv_name_lookup(port, PT_SCTP));
} /* sctp_port_to_display */