aboutsummaryrefslogtreecommitdiff
path: root/src/or/rendservice.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-12-12 02:07:59 -0500
committerNick Mathewson <nickm@torproject.org>2009-12-12 02:07:59 -0500
commit0c1b3070cfec670190636d74f97c2aaf0e521bdb (patch)
treeba893e6987f7b429510cec38a1cb6aaf0dc13793 /src/or/rendservice.c
parent79f72d0ef6cc3ce7cc92146ed0f0bdc7a4acad1a (diff)
downloadtor-0c1b3070cfec670190636d74f97c2aaf0e521bdb.tar.gz
tor-0c1b3070cfec670190636d74f97c2aaf0e521bdb.zip
Now that FOO_free(NULL) always works, remove checks before calling it.
Diffstat (limited to 'src/or/rendservice.c')
-rw-r--r--src/or/rendservice.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index 445fbffb04..de3fa0faec 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -120,15 +120,14 @@ rend_service_free(rend_service_t *service)
rend_intro_point_free(intro););
smartlist_free(service->intro_nodes);
}
- if (service->desc)
- rend_service_descriptor_free(service->desc);
+
+ rend_service_descriptor_free(service->desc);
if (service->clients) {
SMARTLIST_FOREACH(service->clients, rend_authorized_client_t *, c,
rend_authorized_client_free(c););
smartlist_free(service->clients);
}
- if (service->accepted_intros)
- digestmap_free(service->accepted_intros, _tor_free);
+ digestmap_free(service->accepted_intros, _tor_free);
tor_free(service);
}
@@ -485,10 +484,10 @@ rend_service_update_descriptor(rend_service_t *service)
rend_service_descriptor_t *d;
origin_circuit_t *circ;
int i;
- if (service->desc) {
- rend_service_descriptor_free(service->desc);
- service->desc = NULL;
- }
+
+ rend_service_descriptor_free(service->desc);
+ service->desc = NULL;
+
d = service->desc = tor_malloc_zero(sizeof(rend_service_descriptor_t));
d->pk = crypto_pk_dup_key(service->private_key);
d->timestamp = time(NULL);