From 3425f2c11f3d550f241514eebfa5e1ecbb835e89 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Mon, 28 May 2007 21:34:42 +0000 Subject: Segfault less. Somebody needs to look over why exactly this helps. re #436 svn:r10376 --- src/or/directory.c | 2 +- src/or/dirserv.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/or/directory.c b/src/or/directory.c index 4ac44df10b..e837155be8 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -1960,7 +1960,7 @@ directory_handle_command_post(dir_connection_t *conn, const char *headers, if (authdir_mode_handles_descs(options) && !strcmp(url,"/tor/")) { /* server descriptor post */ - const char *msg; + const char *msg = NULL; int r = dirserv_add_multiple_descriptors(body, &msg); tor_assert(msg); if (r > 0) diff --git a/src/or/dirserv.c b/src/or/dirserv.c index 050570b54d..fb2dc6dc53 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -528,6 +528,7 @@ dirserv_add_multiple_descriptors(const char *desc, const char **msg) list = smartlist_create(); if (!router_parse_list_from_string(&s, NULL, list, SAVED_NOWHERE, 0)) { SMARTLIST_FOREACH(list, routerinfo_t *, ri, { + msg_out = NULL; r_tmp = dirserv_add_descriptor(ri, &msg_out); if (r_tmp < r) { r = r_tmp; @@ -541,6 +542,7 @@ dirserv_add_multiple_descriptors(const char *desc, const char **msg) s = desc; if (!router_parse_list_from_string(&s, NULL, list, SAVED_NOWHERE, 1)) { SMARTLIST_FOREACH(list, extrainfo_t *, ei, { + msg_out = NULL; r_tmp = dirserv_add_extrainfo(ei, &msg_out); if (r_tmp < r) { r = r_tmp; -- cgit v1.2.3-54-g00ecf