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

crypto: avoid double free #40380

Closed
wants to merge 4 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/crypto/crypto_util.h
Expand Up @@ -550,9 +550,12 @@ struct EnginePointer {

inline void reset(ENGINE* engine_ = nullptr, bool finish_on_exit_ = false) {
if (engine != nullptr) {
if (finish_on_exit)
if (finish_on_exit) {
// This also does the equivalent of ENGINE_free.
ENGINE_finish(engine);
mhdawson marked this conversation as resolved.
Show resolved Hide resolved
ENGINE_free(engine);
} else {
ENGINE_free(engine);
mhdawson marked this conversation as resolved.
Show resolved Hide resolved
}
}
engine = engine_;
finish_on_exit = finish_on_exit_;
Expand Down