Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

double free in LightGlueOnnxRunner.cpp #24

Open
rebmaso opened this issue Dec 13, 2023 · 1 comment
Open

double free in LightGlueOnnxRunner.cpp #24

rebmaso opened this issue Dec 13, 2023 · 1 comment

Comments

@rebmaso
Copy link

rebmaso commented Dec 13, 2023

[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;
@OroChippw
Copy link
Owner

Thank you for pointing out the bug, we will fix it as soon as possible❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants