Skip to content

Commit

Permalink
Avoid leaving behind a freed pointer
Browse files Browse the repository at this point in the history
This does not lead to a crash because sessions are cached and reused,
but can cause issues (beyond nasty "possible double free" messages),
as it may free a session reused by another thread while it is in use.

Signed-off-by: Simo Sorce <simo@redhat.com>
  • Loading branch information
simo5 committed Oct 13, 2022
1 parent 2c3a293 commit 1291d5e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/store.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ static void store_load(struct p11prov_store_ctx *ctx,

if (ctx->session != NULL) {
p11prov_session_free(ctx->session);
ctx->session = CK_INVALID_HANDLE;
}

ret =
Expand Down

0 comments on commit 1291d5e

Please sign in to comment.