DPP2: Fix a memory leak on error path for Config Result

If only one of the allocations fails, the successful allocation needs to
be freed on the error path.

Fixes: 22f90b32f1 ("DPP2: Configuration Result message generation and processing")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
Jouni Malinen 2019-09-15 16:19:45 +03:00 committed by Jouni Malinen
parent 21dc1627f6
commit 3a6736fe87

View file

@ -6108,7 +6108,7 @@ struct wpabuf * dpp_build_conf_result(struct dpp_authentication *auth,
clear = wpabuf_alloc(clear_len);
msg = dpp_alloc_msg(DPP_PA_CONFIGURATION_RESULT, attr_len);
if (!clear || !msg)
return NULL;
goto fail;
/* DPP Status */
dpp_build_attr_status(clear, status);