From: Nick Mathewson Date: Thu, 28 May 2015 17:14:30 +0000 (-0400) Subject: Fix a bug in earlier torcert fix, fix another. X-Git-Tag: tor-0.2.7.2-alpha~119 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=49c31877b6dd75c268898849941ae44056bf42df;p=thirdparty%2Ftor.git Fix a bug in earlier torcert fix, fix another. --- diff --git a/src/or/torcert.c b/src/or/torcert.c index 095cbb81f6..838501ea49 100644 --- a/src/or/torcert.c +++ b/src/or/torcert.c @@ -68,13 +68,15 @@ tor_cert_sign_impl(const ed25519_keypair_t *signing_key, tor_free(encoded); - return torcert; + goto done; err: tor_cert_free(torcert); + torcert = NULL; + done: ed25519_cert_free(cert); tor_free(encoded); - return NULL; + return torcert; } /** @@ -151,7 +153,7 @@ tor_cert_parse(const uint8_t *encoded, const size_t len) cert = NULL; done: ed25519_cert_free(parsed); - return NULL; + return cert; } /** Fill in checkable_out with the information needed to check