projects
/
tinc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
b7b68c3
)
Don't leak memory during the key generation speed test.
author
Guus Sliepen
<guus@tinc-vpn.org>
Sun, 15 Sep 2013 20:02:33 +0000
(22:02 +0200)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Sun, 15 Sep 2013 20:02:33 +0000
(22:02 +0200)
src/sptps_speed.c
patch
|
blob
|
history
diff --git
a/src/sptps_speed.c
b/src/sptps_speed.c
index
99aaef8
..
69f7599
100644
(file)
--- a/
src/sptps_speed.c
+++ b/
src/sptps_speed.c
@@
-84,9
+84,12
@@
int main(int argc, char *argv[]) {
fprintf(stderr, "Generating keys for 10 seconds: ");
for(clock_start(); clock_countto(10);)
fprintf(stderr, "Generating keys for 10 seconds: ");
for(clock_start(); clock_countto(10);)
-
key1 = ecdsa_generate(
);
+
ecdsa_free(ecdsa_generate()
);
fprintf(stderr, "%13.2lf op/s\n", rate);
fprintf(stderr, "%13.2lf op/s\n", rate);
+ key1 = ecdsa_generate();
+ key2 = ecdsa_generate();
+
// ECDSA signatures
fprintf(stderr, "ECDSA sign for 10 seconds: ");
// ECDSA signatures
fprintf(stderr, "ECDSA sign for 10 seconds: ");
@@
-110,8
+113,6
@@
int main(int argc, char *argv[]) {
// SPTPS authentication phase
// SPTPS authentication phase
- key2 = ecdsa_generate();
-
int fd[2];
if(socketpair(AF_UNIX, SOCK_STREAM, 0, fd)) {
fprintf(stderr, "Could not create a UNIX socket pair: %s\n", strerror(errno));
int fd[2];
if(socketpair(AF_UNIX, SOCK_STREAM, 0, fd)) {
fprintf(stderr, "Could not create a UNIX socket pair: %s\n", strerror(errno));