Browse Source

Fix possible crash due to uninitialized ring_data_t in ringloop

tags/v0.5.1
Vitaliy Filippov 3 months ago
parent
commit
befff09370
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      ringloop.cpp

+ 1
- 1
ringloop.cpp View File

@@ -15,7 +15,7 @@ ring_loop_t::ring_loop_t(int qd)
throw std::runtime_error(std::string("io_uring_queue_init: ") + strerror(-ret));
}
free_ring_data_ptr = *ring.cq.kring_entries;
ring_datas = (struct ring_data_t*)malloc(sizeof(ring_data_t) * free_ring_data_ptr);
ring_datas = (struct ring_data_t*)calloc(free_ring_data_ptr, sizeof(ring_data_t));
free_ring_data = (int*)malloc(sizeof(int) * free_ring_data_ptr);
if (!ring_datas || !free_ring_data)
{


Loading…
Cancel
Save