From d0ebf3285f01640231aac233a09222ec19e69382 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 17 Oct 2010 20:10:09 +0300 Subject: [PATCH] WPS: Remove unused error path code --- src/wps/wps_upnp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/wps/wps_upnp.c b/src/wps/wps_upnp.c index d2e4731..29806ec 100644 --- a/src/wps/wps_upnp.c +++ b/src/wps/wps_upnp.c @@ -307,7 +307,6 @@ static void subscr_addr_add_url(struct subscription *s, const char *url) struct addrinfo *result = NULL; struct addrinfo *rp; int rerr; - struct subscr_addr *a = NULL; /* url MUST begin with http: */ if (os_strncasecmp(url, "http://", 7)) @@ -367,6 +366,8 @@ static void subscr_addr_add_url(struct subscription *s, const char *url) goto fail; } for (rp = result; rp; rp = rp->ai_next) { + struct subscr_addr *a; + /* Limit no. of address to avoid denial of service attack */ if (dl_list_len(&s->addr_list) >= MAX_ADDR_PER_SUBSCRIPTION) { wpa_printf(MSG_INFO, "WPS UPnP: subscr_addr_add_url: " @@ -390,14 +391,12 @@ static void subscr_addr_add_url(struct subscription *s, const char *url) a->saddr.sin_port = htons(port); dl_list_add(&s->addr_list, &a->list); - a = NULL; /* don't free it below */ } fail: if (result) freeaddrinfo(result); os_free(scratch_mem); - os_free(a); } -- 2.1.4