Browse Source

Memory leak in tor_cert_parse. CID gi1301381

Nick Mathewson 9 years ago
parent
commit
3df6f8591d
1 changed files with 4 additions and 2 deletions
  1. 4 2
      src/or/torcert.c

+ 4 - 2
src/or/torcert.c

@@ -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;
 }