From a42adce3628c9b82c91ff21e85c6a2d4fbcefc13 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Sat, 16 Oct 2004 20:38:57 +0000 Subject: fix memory leak in router.c; start relying on NULL==(zero bytes) svn:r2538 --- src/or/routerparse.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/or/routerparse.c') 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: -- cgit v1.2.3