Commit d189baff authored by yiwenshao's avatar yiwenshao

remove memory leak in SWP

parent b354238c
...@@ -140,6 +140,7 @@ main(int argc,char**argv) { ...@@ -140,6 +140,7 @@ main(int argc,char**argv) {
Item* plain = getItemString(input); Item* plain = getItemString(input);
auto res = tokenize(input); auto res = tokenize(input);
control(sw, plain, num_of_tests, length*i,res->size()); control(sw, plain, num_of_tests, length*i,res->size());
delete res;
} }
return 0; return 0;
} }
......
...@@ -1479,7 +1479,7 @@ Search::encrypt(const Item &ptext, uint64_t IV) const ...@@ -1479,7 +1479,7 @@ Search::encrypt(const Item &ptext, uint64_t IV) const
//TODO: remove string, string serves this purpose now.. //TODO: remove string, string serves this purpose now..
const std::list<std::string> * const tokens = tokenize(plainstr); const std::list<std::string> * const tokens = tokenize(plainstr);
const std::string ciph = encryptSWP(key, *tokens); const std::string ciph = encryptSWP(key, *tokens);
delete tokens;
LOG(encl) << "SEARCH encrypt " << plainstr << " --> " << ciph; LOG(encl) << "SEARCH encrypt " << plainstr << " --> " << ciph;
return new Item_string(newmem(ciph), ciph.length(), &my_charset_bin); return new Item_string(newmem(ciph), ciph.length(), &my_charset_bin);
......
...@@ -593,8 +593,8 @@ void storeStrategies(std::vector<FieldMetaTrans>& res){ ...@@ -593,8 +593,8 @@ void storeStrategies(std::vector<FieldMetaTrans>& res){
static const std::vector<onion> onion_order = { static const std::vector<onion> onion_order = {
oDET,
oASHE, oASHE,
oDET,
oOPE, oOPE,
oAGG, oAGG,
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment