From 1a70ab2c0db0a5b1c03f88ea63f447d35d0a7ef9 Mon Sep 17 00:00:00 2001 From: Logan007 Date: Sat, 29 Aug 2020 22:43:16 +0545 Subject: [PATCH] speck transform code clean-up --- src/speck.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/speck.c b/src/speck.c index bfc39ee..d373770 100644 --- a/src/speck.c +++ b/src/speck.c @@ -693,11 +693,13 @@ int speck_init (const unsigned char *k, speck_context_t **ctx) { int speck_deinit (speck_context_t *ctx) { + if(ctx) { #if defined (SPECK_ALIGNED_CTX) - _mm_free (ctx); + _mm_free (ctx); #else - free (ctx); + free (ctx); #endif + } return 0; }