Skip to content

Commit

Permalink
Fix incorrect work of ttls_pk_free function
Browse files Browse the repository at this point in the history
We should set `ctx->pk_info` to NULL in `ttls_pk_free`
function to make `ctx` good for later usage.

Closes #1888
  • Loading branch information
EvgeniiMekhanik committed Jun 5, 2023
1 parent ddcdc81 commit f70f628
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tls/pk.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Based on mbed TLS, https://tls.mbed.org.
*
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
* Copyright (C) 2015-2020 Tempesta Technologies, Inc.
* Copyright (C) 2015-2023 Tempesta Technologies, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -259,6 +259,7 @@ ttls_pk_free(TlsPkCtx *ctx)
if (ctx->pk_info->ctx_free_func)
ctx->pk_info->ctx_free_func(ctx->pk_ctx);

ctx->pk_info = NULL;
ttls_mpi_pool_free(ctx->pk_ctx);
}
EXPORT_SYMBOL(ttls_pk_free);
Expand Down

0 comments on commit f70f628

Please sign in to comment.