From 3a6736fe87ae8d144b92d8b8706fac8a0ee2eae5 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 15 Sep 2019 16:19:45 +0300 Subject: [PATCH] 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: 22f90b32f14e ("DPP2: Configuration Result message generation and processing") Signed-off-by: Jouni Malinen --- src/common/dpp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/dpp.c b/src/common/dpp.c index dcbc80b6b..1d91a7ade 100644 --- a/src/common/dpp.c +++ b/src/common/dpp.c @@ -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);