[or-cvs] r17578: {tor} Fix memory leaks in test_dir_format (tor/trunk/src/or)
nickm at seul.org
nickm at seul.org
Thu Dec 11 06:17:59 UTC 2008
Author: nickm
Date: 2008-12-11 01:17:59 -0500 (Thu, 11 Dec 2008)
New Revision: 17578
Modified:
tor/trunk/src/or/test.c
Log:
Fix memory leaks in test_dir_format
Modified: tor/trunk/src/or/test.c
===================================================================
--- tor/trunk/src/or/test.c 2008-12-11 06:17:54 UTC (rev 17577)
+++ tor/trunk/src/or/test.c 2008-12-11 06:17:59 UTC (rev 17578)
@@ -2874,17 +2874,6 @@
#endif
dirserv_free_fingerprint_list();
- tor_free(pk1_str);
- tor_free(pk2_str);
- tor_free(pk3_str);
- if (pk1) crypto_free_pk_env(pk1);
- if (pk2) crypto_free_pk_env(pk2);
- if (pk3) crypto_free_pk_env(pk3);
- if (rp1) routerinfo_free(rp1);
- if (rp2) routerinfo_free(rp2);
- tor_free(dir1); /* XXXX And more !*/
- tor_free(dir2); /* And more !*/
-
/* Try out version parsing functionality */
test_eq(0, tor_version_parse("0.3.4pre2-cvs", &ver1));
test_eq(0, ver1.major);
@@ -2983,6 +2972,17 @@
routerinfo_free(r1);
if (r2)
routerinfo_free(r2);
+
+ tor_free(pk1_str);
+ tor_free(pk2_str);
+ tor_free(pk3_str);
+ if (pk1) crypto_free_pk_env(pk1);
+ if (pk2) crypto_free_pk_env(pk2);
+ if (pk3) crypto_free_pk_env(pk3);
+ if (rp1) routerinfo_free(rp1);
+ if (rp2) routerinfo_free(rp2);
+ tor_free(dir1); /* XXXX And more !*/
+ tor_free(dir2); /* And more !*/
}
extern const char AUTHORITY_CERT_1[];
More information about the tor-commits
mailing list