From: Ankita Bajaj Date: Mon, 27 Aug 2018 07:31:13 +0000 (+0530) Subject: DPP: Fix an error path memory leak in URI public key parsing X-Git-Tag: hostap_2_7~172 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bae282e3e8f429c8b6fa08b4c468b7165d5ff17a;p=thirdparty%2Fhostap.git 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 --- 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",