From 305000e160f26cfbbe93a099027e23bb2bdc97fc Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 14 Jun 2014 01:05:18 +0300 Subject: [PATCH] WPS: Check wps_build_wfa_ext() return value consistently (CID 68104) While this call cannot really fail, check the return value to be more consistent with all the other wps_build_wfa_ext() calls. Signed-off-by: Jouni Malinen --- src/wps/wps_upnp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wps/wps_upnp.c b/src/wps/wps_upnp.c index f62b49e60..ae94a9f62 100644 --- a/src/wps/wps_upnp.c +++ b/src/wps/wps_upnp.c @@ -596,7 +596,10 @@ static struct wpabuf * build_fake_wsc_ack(void) wpabuf_put_be16(msg, ATTR_REGISTRAR_NONCE); wpabuf_put_be16(msg, WPS_NONCE_LEN); wpabuf_put(msg, WPS_NONCE_LEN); - wps_build_wfa_ext(msg, 0, NULL, 0); + if (wps_build_wfa_ext(msg, 0, NULL, 0)) { + wpabuf_free(msg); + return NULL; + } return msg; }