aboutsummaryrefslogtreecommitdiff
path: root/src/or/routerparse.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-10-16 20:38:57 +0000
committerNick Mathewson <nickm@torproject.org>2004-10-16 20:38:57 +0000
commita42adce3628c9b82c91ff21e85c6a2d4fbcefc13 (patch)
treeb7f04f7a405e5638f21ad1fd86d77e216e517d75 /src/or/routerparse.c
parentb0afd91afec362e3edc58d1928d2a63bcb3097e8 (diff)
downloadtor-a42adce3628c9b82c91ff21e85c6a2d4fbcefc13.tar
tor-a42adce3628c9b82c91ff21e85c6a2d4fbcefc13.tar.gz
fix memory leak in router.c; start relying on NULL==(zero bytes)
svn:r2538
Diffstat (limited to 'src/or/routerparse.c')
-rw-r--r--src/or/routerparse.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 540e8b338..dd858f8fa 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -718,9 +718,8 @@ router_parse_list_from_string(const char **s, routerlist_t **dest,
if (*dest)
routerlist_free(*dest);
- *dest = tor_malloc(sizeof(routerlist_t));
+ *dest = tor_malloc_zero(sizeof(routerlist_t));
(*dest)->routers = routers;
- (*dest)->software_versions = NULL;
return 0;
}
@@ -770,8 +769,6 @@ routerinfo_t *router_parse_entry_from_string(const char *s,
}
router = tor_malloc_zero(sizeof(routerinfo_t));
- router->onion_pkey = router->identity_pkey = NULL;
- router->declared_family = NULL;
ports_set = bw_set = 0;
if (tok->n_args == 2 || tok->n_args == 5 || tok->n_args == 6) {
@@ -1122,7 +1119,6 @@ router_parse_exit_policy(directory_token_t *tok) {
address, inet_ntoa(in), newe->prt_min, newe->prt_max);
tor_free(address);
- newe->next = NULL;
return newe;
policy_read_failed: