[Scummvm-cvs-logs] scummvm master -> 49f3f5e1e8a97a30040ba7f604ae32317099910d

bluegr md5 at scummvm.org
Sat Feb 26 15:32:32 CET 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
49f3f5e1e8 SCI: Fixed a memory leak. Thanks to digitall for finding this using Valgrind


Commit: 49f3f5e1e8a97a30040ba7f604ae32317099910d
    https://github.com/scummvm/scummvm/commit/49f3f5e1e8a97a30040ba7f604ae32317099910d
Author: md5 (md5 at scummvm.org)
Date: 2011-02-26T06:30:47-08:00

Commit Message:
SCI: Fixed a memory leak. Thanks to digitall for finding this using Valgrind

Changed paths:
    engines/sci/engine/kfile.cpp



diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp
index f6dec5d..f2c93fd 100644
--- a/engines/sci/engine/kfile.cpp
+++ b/engines/sci/engine/kfile.cpp
@@ -253,6 +253,7 @@ reg_t kFGets(EngineState *s, int argc, reg_t *argv) {
 	debugC(kDebugLevelFile, "kFGets(%d, %d)", handle, maxsize);
 	int readBytes = fgets_wrapper(s, buf, maxsize, handle);
 	s->_segMan->memcpy(argv[0], (const byte*)buf, maxsize);
+	delete[] buf;
 	return readBytes ? argv[0] : NULL_REG;
 }
 






More information about the Scummvm-git-logs mailing list