diff options
author | rpaulo <rpaulo@FreeBSD.org> | 2015-10-18 21:38:25 +0000 |
---|---|---|
committer | rpaulo <rpaulo@FreeBSD.org> | 2015-10-18 21:38:25 +0000 |
commit | c437e26a1d8c13d53c6b57c8f8a8a28525fb34b0 (patch) | |
tree | 2a6d777bac31b66dc039b0c8eed342049d131f0b /contrib/wpa/src/wps/wps_er.c | |
parent | 7b5d098c90f0f2e5151f5a80014ba3932988a132 (diff) | |
parent | 7726170474c6c89d386ba77b425d186e993a03a0 (diff) | |
download | FreeBSD-src-c437e26a1d8c13d53c6b57c8f8a8a28525fb34b0.zip FreeBSD-src-c437e26a1d8c13d53c6b57c8f8a8a28525fb34b0.tar.gz |
Update hostapd/wpa_supplicant to version 2.5.
Tested by several people on current@/wireless@.
Relnotes: yes
Diffstat (limited to 'contrib/wpa/src/wps/wps_er.c')
-rw-r--r-- | contrib/wpa/src/wps/wps_er.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/contrib/wpa/src/wps/wps_er.c b/contrib/wpa/src/wps/wps_er.c index 078ff72..b840acd 100644 --- a/contrib/wpa/src/wps/wps_er.c +++ b/contrib/wpa/src/wps/wps_er.c @@ -1649,11 +1649,15 @@ static void wps_er_http_put_message_cb(void *ctx, struct http_client *c, case HTTP_CLIENT_OK: wpa_printf(MSG_DEBUG, "WPS ER: PutMessage OK"); reply = http_client_get_body(c); - if (reply == NULL) - break; - msg = os_zalloc(wpabuf_len(reply) + 1); - if (msg == NULL) + if (reply) + msg = os_zalloc(wpabuf_len(reply) + 1); + if (msg == NULL) { + if (ap->wps) { + wps_deinit(ap->wps); + ap->wps = NULL; + } break; + } os_memcpy(msg, wpabuf_head(reply), wpabuf_len(reply)); break; case HTTP_CLIENT_FAILED: @@ -1709,21 +1713,30 @@ static void wps_er_ap_put_message(struct wps_er_ap *ap, url = http_client_url_parse(ap->control_url, &dst, &path); if (url == NULL) { wpa_printf(MSG_DEBUG, "WPS ER: Failed to parse controlURL"); - return; + goto fail; } buf = wps_er_soap_hdr(msg, "PutMessage", "NewInMessage", path, &dst, &len_ptr, &body_ptr); os_free(url); if (buf == NULL) - return; + goto fail; wps_er_soap_end(buf, "PutMessage", len_ptr, body_ptr); ap->http = http_client_addr(&dst, buf, 10000, wps_er_http_put_message_cb, ap); - if (ap->http == NULL) + if (ap->http == NULL) { wpabuf_free(buf); + goto fail; + } + return; + +fail: + if (ap->wps) { + wps_deinit(ap->wps); + ap->wps = NULL; + } } |