aboutsummaryrefslogtreecommitdiff
path: root/src/or/onion.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-01-25 18:09:38 -0500
committerNick Mathewson <nickm@torproject.org>2011-01-25 18:09:38 -0500
commit76582442a8baefe1b469f86d35ce2d00f01a00ca (patch)
tree005100cf30b802625b7a3ea8f81511f0f3b3a7c6 /src/or/onion.c
parentc939c953aef7018f9581d934ef9713e50bd8df16 (diff)
downloadtor-76582442a8baefe1b469f86d35ce2d00f01a00ca.tar.gz
tor-76582442a8baefe1b469f86d35ce2d00f01a00ca.zip
Handle failing cases of DH allocation
Diffstat (limited to 'src/or/onion.c')
-rw-r--r--src/or/onion.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/or/onion.c b/src/or/onion.c
index 9aa16d2747..e1d10a60bb 100644
--- a/src/or/onion.c
+++ b/src/or/onion.c
@@ -259,6 +259,10 @@ onion_skin_server_handshake(const char *onion_skin, /*ONIONSKIN_CHALLENGE_LEN*/
}
dh = crypto_dh_new(DH_TYPE_CIRCUIT);
+ if (!dh) {
+ log_warn(LD_BUG, "Couldn't allocate DH key");
+ goto err;
+ }
if (crypto_dh_get_public(dh, handshake_reply_out, DH_KEY_LEN)) {
log_info(LD_GENERAL, "crypto_dh_get_public failed.");
goto err;