Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not call C_Finalize if not initialized #208

Open
Geobert opened this issue Apr 9, 2024 · 1 comment
Open

Do not call C_Finalize if not initialized #208

Geobert opened this issue Apr 9, 2024 · 1 comment

Comments

@Geobert
Copy link

Geobert commented Apr 9, 2024

Hi,

I’m in a mixed env with Rust code used in a C++ program. C++ side initialize the pkcs11 lib so Rust side can’t.
If Rust side calls C_Finalize, I get a random crash, which, I think, is because of a double free?

@hug-dev
Copy link
Member

hug-dev commented Mar 28, 2025

Hello! Sorry for the long time without answer!

C_Finalize is called when then Pkcs11 instance is dropped. We could potentially add a new constructor which builds an instance that does not auto-finalize :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants