Segfault less. Somebody needs to look over why exactly this helps. re #436

svn:r10376
This commit is contained in:
Peter Palfrader 2007-05-28 21:34:42 +00:00
parent 7ba1d9f3c8
commit 3425f2c11f
2 changed files with 3 additions and 1 deletions

View File

@ -1960,7 +1960,7 @@ directory_handle_command_post(dir_connection_t *conn, const char *headers,
if (authdir_mode_handles_descs(options) && if (authdir_mode_handles_descs(options) &&
!strcmp(url,"/tor/")) { /* server descriptor post */ !strcmp(url,"/tor/")) { /* server descriptor post */
const char *msg; const char *msg = NULL;
int r = dirserv_add_multiple_descriptors(body, &msg); int r = dirserv_add_multiple_descriptors(body, &msg);
tor_assert(msg); tor_assert(msg);
if (r > 0) if (r > 0)

View File

@ -528,6 +528,7 @@ dirserv_add_multiple_descriptors(const char *desc, const char **msg)
list = smartlist_create(); list = smartlist_create();
if (!router_parse_list_from_string(&s, NULL, list, SAVED_NOWHERE, 0)) { if (!router_parse_list_from_string(&s, NULL, list, SAVED_NOWHERE, 0)) {
SMARTLIST_FOREACH(list, routerinfo_t *, ri, { SMARTLIST_FOREACH(list, routerinfo_t *, ri, {
msg_out = NULL;
r_tmp = dirserv_add_descriptor(ri, &msg_out); r_tmp = dirserv_add_descriptor(ri, &msg_out);
if (r_tmp < r) { if (r_tmp < r) {
r = r_tmp; r = r_tmp;
@ -541,6 +542,7 @@ dirserv_add_multiple_descriptors(const char *desc, const char **msg)
s = desc; s = desc;
if (!router_parse_list_from_string(&s, NULL, list, SAVED_NOWHERE, 1)) { if (!router_parse_list_from_string(&s, NULL, list, SAVED_NOWHERE, 1)) {
SMARTLIST_FOREACH(list, extrainfo_t *, ei, { SMARTLIST_FOREACH(list, extrainfo_t *, ei, {
msg_out = NULL;
r_tmp = dirserv_add_extrainfo(ei, &msg_out); r_tmp = dirserv_add_extrainfo(ei, &msg_out);
if (r_tmp < r) { if (r_tmp < r) {
r = r_tmp; r = r_tmp;