소스 검색

Memory leak in tor_cert_parse. CID gi1301381

Nick Mathewson 9 년 전
부모
커밋
3df6f8591d
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  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;
 }