LightGlue-OnnxRunner
LightGlue-OnnxRunner copied to clipboard
double free in LightGlueOnnxRunner.cpp
[in LightGlueOnnxRunner.cpp]
First, thanks for the repo!
Spotted a delete that I think shouldnt be there.
You pass cfg by value, then delete a pointer to cfg.lightgluepath
. This causes a double free error as the pass-by-value cfg object is implicitly deleted after function execution. The faulty line is line 63. Just remove delete modelPath
.
PS: maybe the same thing is in LightGlueDecoupleOnnxRunner.cpp as well, idk
const size_t numOutputNodes = session->GetOutputCount();
OutputNodeNames.reserve(numOutputNodes);
for (size_t i = 0 ; i < numOutputNodes ; i++)
{
OutputNodeNames.emplace_back(_strdup(session->GetOutputNameAllocated(i , allocator).get()));
OutputNodeShapes.emplace_back(session->GetOutputTypeInfo(i).GetTensorTypeAndShapeInfo().GetShape());
}
delete modelPath;
std::cout << "[INFO] ONNXRuntime environment created successfully." << std::endl;
Thank you for pointing out the bug, we will fix it as soon as possible❤️