summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2007-05-28 21:34:42 +0000
committerPeter Palfrader <peter@palfrader.org>2007-05-28 21:34:42 +0000
commit3425f2c11f3d550f241514eebfa5e1ecbb835e89 (patch)
tree5b5ffb9aebab1a7d838d2f90860f39fb815f3a89
parent7ba1d9f3c879279a2d549d10ed429d0ae44057e6 (diff)
downloadtor-3425f2c11f3d550f241514eebfa5e1ecbb835e89.tar.gz
tor-3425f2c11f3d550f241514eebfa5e1ecbb835e89.zip
Segfault less. Somebody needs to look over why exactly this helps. re #436
svn:r10376
-rw-r--r--src/or/directory.c2
-rw-r--r--src/or/dirserv.c2
2 files changed, 3 insertions, 1 deletions
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;