]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP: Fix an error path memory leak in URI public key parsing
authorAnkita Bajaj <bankita@codeaurora.org>
Mon, 27 Aug 2018 07:31:13 +0000 (13:01 +0530)
committerJouni Malinen <j@w1.fi>
Fri, 21 Sep 2018 18:20:06 +0000 (21:20 +0300)
The allocated buffer from base64_decode() needs to be freed on the
sha256_vector() error path.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/common/dpp.c

index c359d556141bb1214acea66280b3d88996441822..f48df43a7765269cd4ee7b626f2397e3f586e37a 100644 (file)
@@ -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",