Skip to content

Commit b600320

Browse files
committed
sha256: tests add missing free
1 parent 2b468eb commit b600320

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

extras/test/src/sha256/test_sha256.cpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,16 @@ static void test_sha256_long_message(uint8_t *digest)
3636
static void test_sha256_message4(uint8_t *digest)
3737
{
3838
/* Message of 929271 bytes */
39-
4039
sha256_ctx ctx;
4140
uint8_t message[1000];
4241
int i;
4342

4443
memset(message, 'a', sizeof (message));
45-
4644
arduino::sha256::begin(&ctx);
4745
for (i = 0; i < 929; i++) {
4846
arduino::sha256::update(&ctx, message, sizeof (message));
4947
}
5048
arduino::sha256::update(&ctx, message, 271);
51-
5249
arduino::sha256::finalize(&ctx, digest);
5350
}
5451

@@ -58,7 +55,6 @@ static int test(const char *vector, uint8_t *digest, uint32_t digest_size)
5855
int i;
5956

6057
output[2 * digest_size] = '\0';
61-
6258
for (i = 0; i < (int) digest_size ; i++) {
6359
sprintf(output + 2 * i, "%02x", digest[i]);
6460
}
@@ -102,4 +98,5 @@ SCENARIO( "FIPS 180-2 Validation tests" ) {
10298
test_sha256_long_message(digest);
10399
REQUIRE(test(vectors[0][4], digest, SHA256_DIGEST_SIZE) == 0);
104100
#endif
101+
free(message3);
105102
}

0 commit comments

Comments
 (0)