Fix valgrind warnings.

This commit is contained in:
Kishore Nallan 2021-09-04 21:59:19 +05:30
parent 2317c6adb0
commit 910256d82c
3 changed files with 6 additions and 2 deletions

View File

@ -1326,7 +1326,7 @@ uint32_t Index::do_filtering(uint32_t** filter_ids_out, const std::vector<filter
}
}
uint32_t* excluded_strt_ids = new uint32_t[strt_ids_size];
uint32_t* excluded_strt_ids = nullptr;
size_t excluded_strt_size = 0;
excluded_strt_size = ArrayUtils::exclude_scalar(ids, ids_size, strt_ids,
strt_ids_size, &excluded_strt_ids);
@ -1338,7 +1338,7 @@ uint32_t Index::do_filtering(uint32_t** filter_ids_out, const std::vector<filter
ids = excluded_strt_ids;
ids_size = excluded_strt_size;
delete[] strt_ids;
} else {
// Otherwise, we just ensure that given record contains tokens in the filter query
uint32_t* out = nullptr;

View File

@ -549,6 +549,7 @@ TEST_F(CollectionManagerTest, Symlinking) {
TEST_F(CollectionManagerTest, LoadMultipleCollections) {
// to prevent fixture tear down from running as we are fudging with CollectionManager singleton
collectionManager.dispose();
delete store;
store = nullptr;

View File

@ -1338,6 +1338,9 @@ TEST_F(PostingListTest, CompactToFullPostingListConversion) {
ASSERT_EQ(4, c1->num_ids());
ASSERT_EQ(4, p1->num_ids());
free(c1);
delete p1;
}
TEST_F(PostingListTest, BlockIntersectionOnMixedLists) {