]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix null dereference on key setup error.
authorNick Mathewson <nickm@torproject.org>
Thu, 28 May 2015 16:46:06 +0000 (12:46 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 28 May 2015 16:46:06 +0000 (12:46 -0400)
CID 1301369

src/or/routerkeys.c

index 7b7a6d02e4ca423bbba81a6f81bf8f24410cd7a5..59169cded77e13649a88ffebd0e7f7625c66c257 100644 (file)
@@ -199,7 +199,8 @@ ed_key_init_from_file(const char *fname, uint32_t flags,
   goto cleanup;
 
  err:
-  memwipe(keypair, 0, sizeof(*keypair));
+  if (keypair)
+    memwipe(keypair, 0, sizeof(*keypair));
   tor_free(keypair);
   tor_cert_free(cert);
   if (cert_out)