]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Memory leak in tor_cert_parse. CID gi1301381
authorNick Mathewson <nickm@torproject.org>
Thu, 28 May 2015 17:09:00 +0000 (13:09 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 28 May 2015 17:09:00 +0000 (13:09 -0400)
src/or/torcert.c

index e2ddffd7a9c8bc8e1f1deef063cd064f29562795..095cbb81f60a58100e09959b0b3a02c163390609 100644 (file)
@@ -145,10 +145,12 @@ tor_cert_parse(const uint8_t *encoded, const size_t len)
     }
   }
 
-  return cert;
+  goto done;
  err:
-  ed25519_cert_free(parsed);
   tor_cert_free(cert);
+  cert = NULL;
+ done:
+  ed25519_cert_free(parsed);
   return NULL;
 }