X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=NetworkPkg%2FHttpDxe%2FHttpsSupport.c;h=9103987a0e4c8ead2d236212c68eeb6ba669e389;hp=5105a2014c25147a209d8d2f326f250ec81e1740;hb=6f3487a79b41e72782c5baea996c294b4ce38960;hpb=1ba4a4df3972cec30b2aa44ff9ff53e5f5eeddc1 diff --git a/NetworkPkg/HttpDxe/HttpsSupport.c b/NetworkPkg/HttpDxe/HttpsSupport.c index 5105a2014c..9103987a0e 100644 --- a/NetworkPkg/HttpDxe/HttpsSupport.c +++ b/NetworkPkg/HttpDxe/HttpsSupport.c @@ -425,9 +425,8 @@ TlsConfigCertificate ( // GetVariable still error or the variable is corrupted. // Fall back to the default value. // - FreePool (CACert); - - return EFI_NOT_FOUND; + Status = EFI_NOT_FOUND; + goto FreeCACert; } ASSERT (CACert != NULL); @@ -451,8 +450,7 @@ TlsConfigCertificate ( CertList->SignatureSize - sizeof (Cert->SignatureOwner) ); if (EFI_ERROR (Status)) { - FreePool (CACert); - return Status; + goto FreeCACert; } Cert = (EFI_SIGNATURE_DATA *) ((UINT8 *) Cert + CertList->SignatureSize); @@ -462,6 +460,7 @@ TlsConfigCertificate ( CertList = (EFI_SIGNATURE_LIST *) ((UINT8 *) CertList + CertList->SignatureListSize); } +FreeCACert: FreePool (CACert); return Status; }