File tree Expand file tree Collapse file tree 1 file changed +1
-3
lines changed
Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Original file line number Diff line number Diff line change @@ -791,7 +791,6 @@ func (k *CAPIKMS) DeleteCertificate(req *apiv1.DeleteCertificateRequest) error {
791791 if certHandle == nil {
792792 return nil
793793 }
794- defer windows .CertFreeCertificateContext (certHandle )
795794
796795 if err := windows .CertDeleteCertificateFromStore (certHandle ); err != nil {
797796 return fmt .Errorf ("failed removing certificate: %w" , err )
@@ -822,7 +821,6 @@ func (k *CAPIKMS) DeleteCertificate(req *apiv1.DeleteCertificateRequest) error {
822821 if certHandle == nil {
823822 return nil
824823 }
825- defer windows .CertFreeCertificateContext (certHandle )
826824
827825 if err := windows .CertDeleteCertificateFromStore (certHandle ); err != nil {
828826 return fmt .Errorf ("failed removing certificate: %w" , err )
@@ -862,10 +860,10 @@ func (k *CAPIKMS) DeleteCertificate(req *apiv1.DeleteCertificateRequest) error {
862860 if certHandle == nil {
863861 return nil
864862 }
865- defer windows .CertFreeCertificateContext (certHandle )
866863
867864 x509Cert , err := certContextToX509 (certHandle )
868865 if err != nil {
866+ defer windows .CertFreeCertificateContext (certHandle )
869867 return fmt .Errorf ("could not unmarshal certificate to DER: %w" , err )
870868 }
871869
You can’t perform that action at this time.
0 commit comments