Fix null dereference on key setup error.

CID 1301369
This commit is contained in:
Nick Mathewson 2015-05-28 12:46:06 -04:00
parent e045c3e1e8
commit 24a2bb08ab

View 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)