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

Memory deallocation error in _qf_multi_merge #14

Open
fazalmajid opened this issue Jun 20, 2023 · 0 comments
Open

Memory deallocation error in _qf_multi_merge #14

fazalmajid opened this issue Jun 20, 2023 · 0 comments

Comments

@fazalmajid
Copy link

ASAN flagged an error, inverted_indexes in _qf_multi_merge is allocated using new[] but deallocated using delete instead of delete[]. This diff fixes this:

diff --git a/third-party/MQF/src/gqf.cpp b/third-party/MQF/src/gqf.cpp
--- a/third-party/MQF/src/gqf.cpp
+++ b/third-party/MQF/src/gqf.cpp
@@ -2883,7 +2883,7 @@
                smallest_key=second_smallest_key;
        }
        // cout<<"before delete"<<endl;
-       delete  inverted_indexes;
+       delete[]  inverted_indexes;
        for(i=0;i<nqf;i++)
        {
                delete qfi_arr[I];
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

1 participant