# HG changeset patch # User thib # Date 1217941011 0 # Node ID 55b577e5f5b5cf3131f0dad45f1482260624ffe1 # Parent fa8511a21d05f9eef7435676ed55961e612addff Some memory leaks fixed diff --git a/music2/wavfile.cc b/music2/wavfile.cc --- a/music2/wavfile.cc +++ b/music2/wavfile.cc @@ -356,6 +356,7 @@ WAVFILE_Converter::~WAVFILE_Converter() delete cvt; cvt = 0; } + delete[] tmpbuf; if (original) delete original; original = 0; } diff --git a/scn2k/scn2k_grp.cc b/scn2k/scn2k_grp.cc --- a/scn2k/scn2k_grp.cc +++ b/scn2k/scn2k_grp.cc @@ -1269,7 +1269,10 @@ void GrpImpl::LoadCgm(AyuSysConfig& conf delete info; - if ( strncmp(data, "CGTABLE", 7) != 0) return; + if ( strncmp(data, "CGTABLE", 7) != 0) { + delete[] data; + return; + } int cgm_size = read_little_endian_int(data+0x10); int i,j; @@ -1289,6 +1292,7 @@ void GrpImpl::LoadCgm(AyuSysConfig& conf int n = read_little_endian_int(dest + i * 36 + 32); cgm_info[s] = n; } + delete[] data; delete[] dest_orig; } diff --git a/scn2k/scn2k_impl.cc b/scn2k/scn2k_impl.cc --- a/scn2k/scn2k_impl.cc +++ b/scn2k/scn2k_impl.cc @@ -865,6 +865,7 @@ string Scn2k::MakeSaveFile(void) const { fname[i] = 0; dir += "/save."; dir += fname; + delete[] fname; return dir; } // セーブファイルの名前をつくる