>>366
> const char *seq1 = new char[h];

配列 new なんか使うからだ。
std::vector<char> seq1(str.begin(), str.end());
にしとけば int h も delete seq1 も要らない。