]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix a bug in earlier torcert fix, fix another.
authorNick Mathewson <nickm@torproject.org>
Thu, 28 May 2015 17:14:30 +0000 (13:14 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 28 May 2015 17:14:30 +0000 (13:14 -0400)
src/or/torcert.c

index 095cbb81f60a58100e09959b0b3a02c163390609..838501ea49473b6a6267f3dc7cab1b079e1f8864 100644 (file)
@@ -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 <b>checkable_out</b> with the information needed to check