Fix memory leak in mac_newctx() on error
authorKurt Roeckx <kurt@roeckx.be>
Thu, 17 Dec 2020 21:28:17 +0000 (22:28 +0100)
committerTomas Mraz <tomas@openssl.org>
Mon, 18 Jan 2021 14:26:29 +0000 (15:26 +0100)
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13702)

providers/implementations/signature/mac_legacy.c

index b92dabde3cc486f547b5df0566ec09b9916228f9..79a5c911a394de1cc27dca32f5b9ac65a260dcfe 100644 (file)
@@ -74,6 +74,7 @@ static void *mac_newctx(void *provctx, const char *propq, const char *macname)
     return pmacctx;
 
  err:
+    OPENSSL_free(pmacctx->propq);
     OPENSSL_free(pmacctx);
     EVP_MAC_free(mac);
     return NULL;