diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2024-03-20 16:41:24 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2024-03-20 16:41:24 -0400 |
commit | 745fd4be765407f7c56d61c281c28e2468ba25b5 (patch) | |
tree | e237deacb2e4b66562a83ef5c6d75016cfc37f89 /src | |
parent | 912d2b94cf6ff0871c07325af5ed520a2bc97722 (diff) | |
download | bfs-745fd4be765407f7c56d61c281c28e2468ba25b5.tar.xz |
ioq: Fix some allocation failure paths
Diffstat (limited to 'src')
-rw-r--r-- | src/ioq.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1064,7 +1064,7 @@ void ioq_free(struct ioq *ioq, struct ioq_ent *ent) { --ioq->size; #if BFS_USE_LIBURING && BFS_USE_STATX - if (ent->op == IOQ_STAT) { + if (ent->op == IOQ_STAT && ent->stat.xbuf) { arena_free(&ioq->xbufs, ent->stat.xbuf); } #endif @@ -1083,7 +1083,9 @@ void ioq_destroy(struct ioq *ioq) { return; } - ioq_cancel(ioq); + if (ioq->nthreads > 0) { + ioq_cancel(ioq); + } for (size_t i = 0; i < ioq->nthreads; ++i) { ioq_thread_join(&ioq->threads[i]); |