summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/dev.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/dev.c b/src/lib/dev.c
index 85dbfb0a..e216baab 100644
--- a/src/lib/dev.c
+++ b/src/lib/dev.c
@@ -713,6 +713,7 @@ __attribute__((constructor)) static void init(int argc,
fail_fds:
fprintf(stderr, "FATAL: ouroboros-dev init failed. "
"Make sure an IRMd is running.\n\n");
+ memset(&ai, 0, sizeof(ai));
exit(EXIT_FAILURE);
}
@@ -720,6 +721,9 @@ __attribute__((destructor)) static void fini(void)
{
int i = 0;
+ if (ai.fds == NULL)
+ return;
+
bmp_destroy(ai.fds);
bmp_destroy(ai.fqueues);