From bae282e3e8f429c8b6fa08b4c468b7165d5ff17a Mon Sep 17 00:00:00 2001 From: Ankita Bajaj Date: Mon, 27 Aug 2018 13:01:13 +0530 Subject: [PATCH] DPP: Fix an error path memory leak in URI public key parsing The allocated buffer from base64_decode() needs to be freed on the sha256_vector() error path. Signed-off-by: Jouni Malinen --- src/common/dpp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common/dpp.c b/src/common/dpp.c index c359d5561..f48df43a7 100644 --- a/src/common/dpp.c +++ b/src/common/dpp.c @@ -840,6 +840,7 @@ static int dpp_parse_uri_pk(struct dpp_bootstrap_info *bi, const char *info) if (sha256_vector(1, (const u8 **) &data, &data_len, bi->pubkey_hash) < 0) { wpa_printf(MSG_DEBUG, "DPP: Failed to hash public key"); + os_free(data); return -1; } wpa_hexdump(MSG_DEBUG, "DPP: Public key hash",