changeset 8:55b577e5f5b5

Some memory leaks fixed
author thib
date Tue, 05 Aug 2008 12:56:51 +0000
parents fa8511a21d05
children b6d6c0ffb423
files music2/wavfile.cc scn2k/scn2k_grp.cc scn2k/scn2k_impl.cc
diffstat 3 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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;
 }
--- 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;
 }
 
--- 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;
 }
 // セーブファイルの名前をつくる