mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 21:23:58 +01:00
Fix a warning, add an assert.
svn:r4875
This commit is contained in:
parent
70fe2a6cee
commit
cd2bb915ed
@ -857,9 +857,8 @@ router_mark_as_down(const char *digest)
|
||||
* will either be inserted into the routerlist or freed. Returns 0 if the
|
||||
* router was added; less than 0 if it was not.
|
||||
*
|
||||
* If we're returning an error and <b>msg</b> is not NULL, then assign to
|
||||
* *<b>msg</b> a static string describing the reason for refusing the
|
||||
* routerinfo.
|
||||
* If we're returning an error, then assign to *<b>msg</b> a static string
|
||||
* describing the reason for refusing the routerinfo.
|
||||
*
|
||||
* If the return value is less than -1, there was a problem with the
|
||||
* routerinfo. If the return value is equal to -1, then the routerinfo was
|
||||
@ -873,6 +872,8 @@ router_add_to_routerlist(routerinfo_t *router, const char **msg)
|
||||
int authdir = get_options()->AuthoritativeDir;
|
||||
int authdir_verified = 0;
|
||||
|
||||
tor_assert(msg);
|
||||
|
||||
if (!routerlist) {
|
||||
routerlist = tor_malloc_zero(sizeof(routerlist_t));
|
||||
routerlist->routers = smartlist_create();
|
||||
@ -1064,7 +1065,7 @@ router_load_routerlist_from_directory(const char *s,
|
||||
smartlist_t *changed = smartlist_create();
|
||||
SMARTLIST_FOREACH(new_list->routers, routerinfo_t *, r,
|
||||
{
|
||||
char *msg;
|
||||
const char *msg;
|
||||
if (router_add_to_routerlist(r,&msg)==0)
|
||||
smartlist_add(changed, r);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user