mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-29 16:44:10 +02:00
NetworkPkg/HttpDxe: use error handler epilogue in TlsConfigCertificate()
Introduce a FreeCACert label near the end of the function, so that we can keep the FreePool(CACert) statement centralized for error and success exits. Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
This commit is contained in:
parent
1ba4a4df39
commit
6f3487a79b
@ -425,9 +425,8 @@ TlsConfigCertificate (
|
|||||||
// GetVariable still error or the variable is corrupted.
|
// GetVariable still error or the variable is corrupted.
|
||||||
// Fall back to the default value.
|
// Fall back to the default value.
|
||||||
//
|
//
|
||||||
FreePool (CACert);
|
Status = EFI_NOT_FOUND;
|
||||||
|
goto FreeCACert;
|
||||||
return EFI_NOT_FOUND;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSERT (CACert != NULL);
|
ASSERT (CACert != NULL);
|
||||||
@ -451,8 +450,7 @@ TlsConfigCertificate (
|
|||||||
CertList->SignatureSize - sizeof (Cert->SignatureOwner)
|
CertList->SignatureSize - sizeof (Cert->SignatureOwner)
|
||||||
);
|
);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
FreePool (CACert);
|
goto FreeCACert;
|
||||||
return Status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Cert = (EFI_SIGNATURE_DATA *) ((UINT8 *) Cert + CertList->SignatureSize);
|
Cert = (EFI_SIGNATURE_DATA *) ((UINT8 *) Cert + CertList->SignatureSize);
|
||||||
@ -462,6 +460,7 @@ TlsConfigCertificate (
|
|||||||
CertList = (EFI_SIGNATURE_LIST *) ((UINT8 *) CertList + CertList->SignatureListSize);
|
CertList = (EFI_SIGNATURE_LIST *) ((UINT8 *) CertList + CertList->SignatureListSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FreeCACert:
|
||||||
FreePool (CACert);
|
FreePool (CACert);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user