aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-03-27 18:23:53 -0400
committerNick Mathewson <nickm@torproject.org>2018-03-27 18:23:53 -0400
commit5acfc3087663340f55de6081cdd13b484525f43a (patch)
tree633eb49a5791e24aa2dcb553e6306f964f777c38 /src/or
parent068d092749508bae84e6d5fce605d2f40c1bdb80 (diff)
parent4bb7d9fd1241a3c263636efa03ee8c62ab744515 (diff)
downloadtor-5acfc3087663340f55de6081cdd13b484525f43a.tar.gz
tor-5acfc3087663340f55de6081cdd13b484525f43a.zip
Merge branch 'maint-0.2.9' into maint-0.3.1
Diffstat (limited to 'src/or')
-rw-r--r--src/or/nodelist.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/or/nodelist.c b/src/or/nodelist.c
index c754ebdb6e..aaec39f7b8 100644
--- a/src/or/nodelist.c
+++ b/src/or/nodelist.c
@@ -291,13 +291,12 @@ nodelist_add_microdesc(microdesc_t *md)
if (rs == NULL)
return NULL;
node = node_get_mutable_by_id(rs->identity_digest);
- if (node) {
- if (node->md)
- node->md->held_by_nodes--;
- node->md = md;
- md->held_by_nodes++;
- }
-
+ if (node == NULL)
+ return NULL;
+ if (node->md)
+ node->md->held_by_nodes--;
+ node->md = md;
+ md->held_by_nodes++;
node_add_to_address_set(node);
return node;