X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=NetworkPkg%2FHttpDxe%2FHttpsSupport.c;h=baab77225fdfedf0570e7e6180469fd148cd158f;hp=5105a2014c25147a209d8d2f326f250ec81e1740;hb=78a6782158db2711c3192e46d0cf06f48d28d406;hpb=07bd82d42bab4defd777dc21b3aa627469dc347e diff --git a/NetworkPkg/HttpDxe/HttpsSupport.c b/NetworkPkg/HttpDxe/HttpsSupport.c index 5105a2014c..baab77225f 100644 --- a/NetworkPkg/HttpDxe/HttpsSupport.c +++ b/NetworkPkg/HttpDxe/HttpsSupport.c @@ -423,11 +423,8 @@ TlsConfigCertificate ( if (EFI_ERROR (Status)) { // // GetVariable still error or the variable is corrupted. - // Fall back to the default value. // - FreePool (CACert); - - return EFI_NOT_FOUND; + goto FreeCACert; } ASSERT (CACert != NULL); @@ -451,8 +448,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 +458,7 @@ TlsConfigCertificate ( CertList = (EFI_SIGNATURE_LIST *) ((UINT8 *) CertList + CertList->SignatureListSize); } +FreeCACert: FreePool (CACert); return Status; }