diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2023-11-15 16:09:47 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2023-11-15 16:10:03 -0500 |
commit | 949a197112e2de23c31f2afb1247bf3568097b69 (patch) | |
tree | 5f937159aa4af0825382e4698d6e1c0e0cd8939e /src/ioq.c | |
parent | f4e8084414e07a8e03cb279090bbcf9eea76ed1e (diff) | |
download | bfs-949a197112e2de23c31f2afb1247bf3568097b69.tar.xz |
ioq: Don't crash on allocation failures
Diffstat (limited to 'src/ioq.c')
-rw-r--r-- | src/ioq.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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]); } |