diff --git a/test/default/kdf.c b/test/default/kdf.c index 8716de08..0c9c7122 100644 --- a/test/default/kdf.c +++ b/test/default/kdf.c @@ -13,8 +13,9 @@ tv_kdf(void) int ret; context = (char *) sodium_malloc(crypto_kdf_CONTEXTBYTES); - memcpy(context, "KDF test", strlen("KDF test")); master_key = (unsigned char *) sodium_malloc(crypto_kdf_KEYBYTES); + + memcpy(context, "KDF test", strlen("KDF test")); for (i = 0; i < crypto_kdf_KEYBYTES; i++) { master_key[i] = i; } @@ -41,6 +42,9 @@ tv_kdf(void) sodium_free(subkey); } + sodium_free(master_key); + sodium_free(context); + assert(strcmp(crypto_kdf_primitive(), crypto_kdf_PRIMITIVE) == 0); assert(crypto_kdf_BYTES_MAX > 0); assert(crypto_kdf_BYTES_MIN <= crypto_kdf_BYTES_MAX);