summaryrefslogtreecommitdiffstats
path: root/src/ioq.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2023-11-15 16:09:47 -0500
committerTavian Barnes <tavianator@tavianator.com>2023-11-15 16:10:03 -0500
commit949a197112e2de23c31f2afb1247bf3568097b69 (patch)
tree5f937159aa4af0825382e4698d6e1c0e0cd8939e /src/ioq.c
parentf4e8084414e07a8e03cb279090bbcf9eea76ed1e (diff)
downloadbfs-949a197112e2de23c31f2afb1247bf3568097b69.tar.xz
ioq: Don't crash on allocation failures
Diffstat (limited to 'src/ioq.c')
-rw-r--r--src/ioq.c4
1 files changed, 4 insertions, 0 deletions
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]);
}