summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2021-02-19 06:25:51 -0700
committerJens Axboe <axboe@kernel.dk>2021-02-19 06:25:51 -0700
commitb84afc4d675705adb980effcae6c1818eccd9ca8 (patch)
tree6c496483982c1bd0d7fe548c92dfd79658a47692
parent0a3b79c82d11f9d9a65351fd9cc130da50f1da65 (diff)
parentaa8c962c174dd4439d9abfb3d7ae0d2d69e96438 (diff)
downloadliburing-b84afc4d675705adb980effcae6c1818eccd9ca8.tar.gz
liburing-b84afc4d675705adb980effcae6c1818eccd9ca8.tar.bz2
Merge branch 'master' of https://github.com/ZhiqiangLiu26/liburing
* 'master' of https://github.com/ZhiqiangLiu26/liburing: setup: check whether malloc succ before using it
-rw-r--r--src/setup.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/setup.c b/src/setup.c
index 062eaa0..94fec90 100644
--- a/src/setup.c
+++ b/src/setup.c
@@ -185,7 +185,10 @@ struct io_uring_probe *io_uring_get_probe_ring(struct io_uring *ring)
size_t len = sizeof(*probe) + 256 * sizeof(struct io_uring_probe_op);
probe = malloc(len);
+ if (!probe)
+ return NULL;
memset(probe, 0, len);
+
r = io_uring_register_probe(ring, probe, 256);
if (r < 0)
goto fail;