summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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 5a02648c5c..26f990b08c 100644
--- a/src/or/nodelist.c
+++ b/src/or/nodelist.c
@@ -263,13 +263,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;