diff music2/koedec.cc @ 50:35ce1a30f3f9

* Added va_end where there is a va_start * Used NULL instead of 0 (so it works on 64b)
author thib
date Fri, 17 Apr 2009 18:38:06 +0000
parents 53a311ea8289
children 15a18fbe6f21
line wrap: on
line diff
--- a/music2/koedec.cc
+++ b/music2/koedec.cc
@@ -114,13 +114,17 @@ AvgKoeInfo AvgKoeCache::Find(int file_nu
 			//FIXME: OMG that's ugly, improve it as soon as you can!
 			DIRFILE* koedir = (DIRFILE*) file_searcher.MakeARCFILE((FILESEARCH::ARCTYPE)0, "koe");
 			sprintf(fname, "%04d", file_number);
-			koedir = new DIRFILE(koedir->SearchFile(fname));
+			char* dirname = koedir->SearchFile(fname);
+			delete koedir;
+			koedir = new DIRFILE(dirname);
+			delete[] dirname;
 			sprintf(fname, "z%04d%05d.ogg", file_number, index);
 			arcinfo = koedir->Find(fname, ".ogg");
 			delete koedir;
 
 			if (arcinfo == 0) return info;
 			FILE* stream = arcinfo->OpenFile(&info.length);
+			delete arcinfo;
 			info.type = koe_ogg;
 			info.stream = stream;
 			return info;