From f6ed8f15625123b736e466bcc9aa581246ef0f88 Mon Sep 17 00:00:00 2001 From: Jeremy Lakeman Date: Mon, 12 Nov 2012 10:38:24 +1030 Subject: [PATCH] Fix segfaults --- directory_client.c | 2 +- directory_service.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/directory_client.c b/directory_client.c index 0146eb4b..f67ba222 100644 --- a/directory_client.c +++ b/directory_client.c @@ -103,6 +103,7 @@ static void directory_update(struct sched_ent *alarm){ if (subscriber_is_reachable(directory_service) != REACHABLE_NONE){ directory_send_keyring(directory_service); + unschedule(alarm); alarm->alarm = gettime_ms() + DIRECTORY_UPDATE_INTERVAL; alarm->deadline = alarm->alarm + 10000; schedule(alarm); @@ -112,7 +113,6 @@ static void directory_update(struct sched_ent *alarm){ } int directory_service_init(){ - unschedule(&directory_alarm); directory_update(&directory_alarm); return 0; } diff --git a/directory_service.c b/directory_service.c index bba84acc..4a86b9e4 100644 --- a/directory_service.c +++ b/directory_service.c @@ -14,7 +14,7 @@ struct item{ time_ms_t expires; }; -struct item *root; +struct item *root=NULL; static struct item *create_item(const char *key){ struct item *ret=calloc(1,sizeof(struct item));