]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP: Fix a memory leak on an error path
authorJouni Malinen <jouni@qca.qualcomm.com>
Wed, 29 Nov 2017 11:03:48 +0000 (13:03 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 29 Nov 2017 11:03:48 +0000 (13:03 +0200)
Need to free temporary allocations if dpp_build_conf_start() fails to
allocate memory.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/common/dpp.c

index 74cdddac757d5cc0d7a0cacbc8ebdfdb001e9a26..c70f73b0c1ee37e4a0ebe2cd85749bd1f230c810 100644 (file)
@@ -4149,7 +4149,7 @@ skip_groups:
        tailroom += signed1_len + signed2_len + signed3_len;
        buf = dpp_build_conf_start(auth, conf, tailroom);
        if (!buf)
-               return NULL;
+               goto fail;
 
        wpabuf_put_str(buf, "\"cred\":{\"akm\":\"dpp\",\"signedConnector\":\"");
        wpabuf_put_str(buf, signed1);