From 949a197112e2de23c31f2afb1247bf3568097b69 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 15 Nov 2023 16:09:47 -0500 Subject: ioq: Don't crash on allocation failures --- src/ioq.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/ioq.c') diff --git a/src/ioq.c b/src/ioq.c index ef89fa8..bd8d111 100644 --- a/src/ioq.c +++ b/src/ioq.c @@ -216,6 +216,10 @@ bfs_static_assert(IOQ_STRIDE % 2 == 1); /** Destroy an I/O command queue. */ static void ioqq_destroy(struct ioqq *ioqq) { + if (!ioqq) { + return; + } + for (size_t i = 0; i < ioqq->monitor_mask + 1; ++i) { ioq_monitor_destroy(&ioqq->monitors[i]); } -- cgit v1.2.3