From 14080744dba2c170b6bc718aef1c89e1e175eefe Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 25 Oct 2017 12:51:33 -0700 Subject: Get rid of a no-longer-needed variable. We don't need a temporary IPv4 address variable in get_host_ipaddr(), we can just use the pointer we've been handed. Change-Id: Id7cbd0c14b2eeb3efde5a556f3414bd635411908 Reviewed-on: https://code.wireshark.org/review/24056 Reviewed-by: Guy Harris --- epan/addr_resolv.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/epan/addr_resolv.c b/epan/addr_resolv.c index b49dc78311..358f21fee3 100644 --- a/epan/addr_resolv.c +++ b/epan/addr_resolv.c @@ -3120,7 +3120,6 @@ c_ares_ghi_cb(void *arg, int status, int timeouts _U_, struct hostent *hp) { gboolean get_host_ipaddr(const char *host, guint32 *addrp) { - guint32 ipaddr; #ifdef HAVE_C_ARES struct timeval tv = { 0, GHI_TIMEOUT }, *tvp; int nfds; @@ -3138,7 +3137,7 @@ get_host_ipaddr(const char *host, guint32 *addrp) * that's *only* supposed to be an IPv4 address, and where it * *shouldn't* translate host names? */ - if (!ws_inet_pton4(host, &ipaddr)) { + if (!ws_inet_pton4(host, addrp)) { /* It's not a valid dotted-quad IP address; is it a valid * host name? @@ -3188,7 +3187,6 @@ get_host_ipaddr(const char *host, guint32 *addrp) return FALSE; } - *addrp = ipaddr; return TRUE; } -- cgit v1.2.3