From 0a1f6a1d7c6a900862ce8e86a92fedc14a9bfa94 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Mon, 22 Apr 2019 13:17:44 -0700 Subject: [PATCH] unit: update test-sae to free SM This unit test was relying on the bad behavior of SAE to free the SM internally. Now we explicitly free the SM in each test. --- unit/test-sae.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/unit/test-sae.c b/unit/test-sae.c index 81220d9c..33357573 100644 --- a/unit/test-sae.c +++ b/unit/test-sae.c @@ -212,6 +212,7 @@ static void test_confirm_timeout(const void *arg) assert(td->status != 0); test_destruct(td); + sae_sm_free(sm); } static void test_commit_timeout(const void *arg) @@ -236,6 +237,7 @@ static void test_commit_timeout(const void *arg) assert(td->status != 0); test_destruct(td); + sae_sm_free(sm); } static void test_clogging(const void *arg) @@ -313,6 +315,7 @@ static void test_malformed_commit(const void *arg) assert(td->status != 0); test_destruct(td); + sae_sm_free(sm); } static void test_malformed_confirm(const void *arg) @@ -330,6 +333,7 @@ static void test_malformed_confirm(const void *arg) assert(td->status != 0); test_destruct(td); + sae_sm_free(sm); } static uint8_t aa_commit_bad_group[] = { @@ -355,6 +359,7 @@ static void test_bad_group(const void *arg) assert(td->status == MMPDU_STATUS_CODE_UNSUPP_FINITE_CYCLIC_GROUP); test_destruct(td); + sae_sm_free(sm); } static int end_to_end_tx_func(const uint8_t *dest, const uint8_t *frame, @@ -419,6 +424,8 @@ static void test_bad_confirm(const void *arg) handshake_state_free(hs1); handshake_state_free(hs2); sae_sm_free(sm1); + sae_sm_free(sm2); + /* sm2 gets freed by sae since it failed */ l_free(td1); l_free(td2);