PK: Fix free(NULL) in library and tests
free() functions are documented as no-ops on NULL. Implement and test this correctly.
This commit is contained in:
parent
e146e7dbae
commit
1f19fa6f62
2 changed files with 7 additions and 4 deletions
library
|
@ -90,8 +90,7 @@ void mbedtls_pk_restart_init( mbedtls_pk_restart_ctx *ctx )
|
|||
*/
|
||||
void mbedtls_pk_restart_free( mbedtls_pk_restart_ctx *ctx )
|
||||
{
|
||||
PK_VALIDATE( ctx != NULL );
|
||||
if( ctx->pk_info == NULL ||
|
||||
if( ctx == NULL || ctx->pk_info == NULL ||
|
||||
ctx->pk_info->rs_free_func == NULL )
|
||||
{
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue