소스 검색

Fix a memory leak in build_unopened_fourhop

This is a unit-test-only leak, but let's fix it anyway so it doesn't
hide real bugs.

Bug not in any released version of Tor.
Nick Mathewson 6 년 전
부모
커밋
2484d1eb35
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      src/test/test_circuitstats.c

+ 2 - 0
src/test/test_circuitstats.c

@@ -82,6 +82,8 @@ build_unopened_fourhop(struct timeval circ_start_time)
   onion_append_hop(&or_circ->cpath, fakehop);
   onion_append_hop(&or_circ->cpath, fakehop);
 
+  tor_free(fakehop);
+
   return or_circ;
 }