Description
Description
In the DelayWorker
setup loop, a memory leak could occur if one of theDelayWorkers[i].Initialize(...)
calls failed.
msquic/src/perf/lib/PerfServer.cpp
Lines 105 to 115 in be90c9c
Suggested Fix
This could be fixed by adding a cleanup step using delete[]
on the DelayWorkers
array and setting it to nullptr:
DelayWorkers = new (std::nothrow) DelayWorker[ProcCount];
for (uint16_t i = 0; i < ProcCount; ++i) {
if (!DelayWorkers[i].Initialize(this, i)) {
+ delete[] DelayWorkers; // Missing
+ DelayWorkers = nullptr; // Missing
WriteOutput("Failed to init delay workers.\n");
return QUIC_STATUS_INTERNAL_ERROR;
}
}