|
@@ -605,6 +605,7 @@ test_dir_load_routers(void *arg)
|
|
|
smartlist_t *wanted = smartlist_new();
|
|
|
char buf[DIGEST_LEN];
|
|
|
char *mem_op_hex_tmp = NULL;
|
|
|
+ char *list = NULL;
|
|
|
|
|
|
#define ADD(str) \
|
|
|
do { \
|
|
@@ -630,7 +631,7 @@ test_dir_load_routers(void *arg)
|
|
|
/* Not ADDing BAD_PORTS */
|
|
|
ADD(EX_RI_BAD_TOKENS);
|
|
|
|
|
|
- char *list = smartlist_join_strings(chunks, "", 0, NULL);
|
|
|
+ list = smartlist_join_strings(chunks, "", 0, NULL);
|
|
|
tt_int_op(1, OP_EQ,
|
|
|
router_load_routers_from_string(list, NULL, SAVED_IN_JOURNAL,
|
|
|
wanted, 1, NULL));
|
|
@@ -670,6 +671,7 @@ test_dir_load_routers(void *arg)
|
|
|
smartlist_free(chunks);
|
|
|
SMARTLIST_FOREACH(wanted, char *, cp, tor_free(cp));
|
|
|
smartlist_free(wanted);
|
|
|
+ tor_free(list);
|
|
|
}
|
|
|
|
|
|
static int mock_get_by_ei_dd_calls = 0;
|
|
@@ -722,6 +724,7 @@ test_dir_load_extrainfo(void *arg)
|
|
|
smartlist_t *wanted = smartlist_new();
|
|
|
char buf[DIGEST_LEN];
|
|
|
char *mem_op_hex_tmp = NULL;
|
|
|
+ char *list = NULL;
|
|
|
|
|
|
#define ADD(str) \
|
|
|
do { \
|
|
@@ -746,7 +749,7 @@ test_dir_load_extrainfo(void *arg)
|
|
|
ADD(EX_EI_BAD_TOKENS);
|
|
|
ADD(EX_EI_BAD_SIG2);
|
|
|
|
|
|
- char *list = smartlist_join_strings(chunks, "", 0, NULL);
|
|
|
+ list = smartlist_join_strings(chunks, "", 0, NULL);
|
|
|
router_load_extrainfo_from_string(list, NULL, SAVED_IN_JOURNAL, wanted, 1);
|
|
|
|
|
|
/* The "maximal" router was added. */
|
|
@@ -788,6 +791,7 @@ test_dir_load_extrainfo(void *arg)
|
|
|
smartlist_free(chunks);
|
|
|
SMARTLIST_FOREACH(wanted, char *, cp, tor_free(cp));
|
|
|
smartlist_free(wanted);
|
|
|
+ tor_free(list);
|
|
|
}
|
|
|
|
|
|
static void
|