mirror of
https://git.proxmox.com/git/pve-common
synced 2025-08-05 15:52:43 +00:00
fix #3259: always free certificate file after reading it
This commit mirrors e3c4007bc94956962c03da8c6853415d2fdf057c in pve-cluster. The fix there got lost with a refactoring for reusing the code here in pve-common in c92b771669e68a8b49906b8a0a68b533750567b0 Tested by repeadetly reading https://$pve-node:8006/nodes on a virtual testcluster. Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
This commit is contained in:
parent
dc00c0529d
commit
eb6262a6b7
@ -199,10 +199,8 @@ my $read_certificate = sub {
|
||||
or $ssl_die->("unable to read '$cert_path' - $!\n");
|
||||
|
||||
my $cert = Net::SSLeay::PEM_read_bio_X509($bio);
|
||||
if (!$cert) {
|
||||
Net::SSLeay::BIO_free($bio);
|
||||
die "unable to read certificate from '$cert_path'\n";
|
||||
}
|
||||
Net::SSLeay::BIO_free($bio);
|
||||
die "unable to read certificate from '$cert_path'\n" if !$cert;
|
||||
|
||||
return $cert;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user