aboutsummaryrefslogtreecommitdiff
path: root/src/or/onion_ntor.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/onion_ntor.c')
-rw-r--r--src/or/onion_ntor.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/or/onion_ntor.c b/src/or/onion_ntor.c
index b601d1ebb1..58ab107f1b 100644
--- a/src/or/onion_ntor.c
+++ b/src/or/onion_ntor.c
@@ -78,7 +78,10 @@ onion_skin_ntor_create(const uint8_t *router_id,
memcpy(state->router_id, router_id, DIGEST_LEN);
memcpy(&state->pubkey_B, router_key, sizeof(curve25519_public_key_t));
- curve25519_secret_key_generate(&state->seckey_x, 0);
+ if (curve25519_secret_key_generate(&state->seckey_x, 0) < 0) {
+ tor_free(state);
+ return -1;
+ }
curve25519_public_key_generate(&state->pubkey_X, &state->seckey_x);
op = onion_skin_out;