Skip to content

Commit e5f25b6

Browse files
committed
tests+timing - silence valgrind warning (memleak)
1 parent 03437a1 commit e5f25b6

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

demos/timing.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,7 @@ static const struct {
674674
}
675675
t2 >>= 2;
676676
fprintf(stderr, "DSA-(%lu, %lu) make_key took %15"PRI64"u cycles\n", (unsigned long)groups[x].group*8, (unsigned long)groups[x].modulus*8, t2);
677+
dsa_free(&key);
677678
}
678679
fprintf(stderr, "\n\n");
679680
}

tests/file_test.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ int file_test(void)
2323

2424
len = sizeof(buf);
2525
if ((in = fopen(fname, "rb")) == NULL) return CRYPT_FILE_NOTFOUND;
26-
if ((err = hash_filehandle(isha256, in, buf, &len)) != CRYPT_OK) return err;
26+
err = hash_filehandle(isha256, in, buf, &len);
27+
fclose(in);
28+
if (err != CRYPT_OK) return err;
2729
if (compare_testvector(buf, len, exp_sha256, 32, "hash_filehandle", 1)) return 1;
2830

2931
len = sizeof(buf);

tests/rsa_test.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ static int rsa_compat_test(void)
193193
fprintf(stderr, "RSA rsa_verify_hash_ex + LTC_PKCS_1_V1_5_NA1 failed\n");
194194
return 1;
195195
}
196+
rsa_free(&pubkey);
196197

197198
/* now try to export private/public and compare */
198199
len = sizeof(buf);

0 commit comments

Comments
 (0)