[Scummvm-cvs-logs] scummvm master -> 3c0c6a5cb140b7ff84bbd5ba0fda6c5ddac68a09

sev- sev at scummvm.org
Wed Apr 24 00:29:02 CEST 2013


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

Summary:
cfbc8be757 SCUMM: Fix non-terminated string. CID 1003867
92780a3320 GUI: Fix memory leak. CID 1003569
c471a4120b GUI: Plug memory leak. CID 1003572
3c0c6a5cb1 SWORD25: Plug memory leak. CID 1003589


Commit: cfbc8be75735370a4e87525a9b69b4556e24b9a9
    https://github.com/scummvm/scummvm/commit/cfbc8be75735370a4e87525a9b69b4556e24b9a9
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-04-23T15:08:09-07:00

Commit Message:
SCUMM: Fix non-terminated string. CID 1003867

Changed paths:
    engines/scumm/script_v4.cpp



diff --git a/engines/scumm/script_v4.cpp b/engines/scumm/script_v4.cpp
index 1de9f08..ec3ac4b 100644
--- a/engines/scumm/script_v4.cpp
+++ b/engines/scumm/script_v4.cpp
@@ -415,7 +415,7 @@ void ScummEngine_v4::o4_saveLoadGame() {
 				char* ptr;
 				int firstSlot = (_game.id == GID_LOOM) ? STRINGID_SAVENAME1_LOOM : STRINGID_SAVENAME1;
 				ptr = (char *)getStringAddress(slot + firstSlot - 1);
-				strncpy(name, ptr, sizeof(name));
+				Common::strlcpy(name, ptr, sizeof(name));
 			}
 
 			if (savePreparedSavegame(slot, name))


Commit: 92780a33203e63dd2572c7fa4dcfe37d36b0966d
    https://github.com/scummvm/scummvm/commit/92780a33203e63dd2572c7fa4dcfe37d36b0966d
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-04-23T15:16:31-07:00

Commit Message:
GUI: Fix memory leak. CID 1003569

Changed paths:
    gui/predictivedialog.cpp



diff --git a/gui/predictivedialog.cpp b/gui/predictivedialog.cpp
index ed18847..5ce093e 100644
--- a/gui/predictivedialog.cpp
+++ b/gui/predictivedialog.cpp
@@ -779,7 +779,7 @@ bool PredictiveDialog::searchWord(const char *const where, const Common::String
 }
 
 void PredictiveDialog::addWord(Dict &dict, const Common::String &word, const Common::String &code) {
-	char *newLine;
+	char *newLine = 0;
 	Common::String tmpCode = code + ' ';
 	int line = binarySearch(dict.dictLine, tmpCode, dict.dictLineCount);
 	if (line >= 0) {
@@ -856,6 +856,9 @@ void PredictiveDialog::addWord(Dict &dict, const Common::String &word, const Com
 	char **newDictLine = (char **)calloc(1, sizeof(char *) * (dict.dictLineCount + 1));
 	if (!newDictLine) {
 		warning("Predictive Dialog: cannot allocate memory for index buffer");
+
+		free(newLine);
+
 		return;
 	}
 	newDictLine[dict.dictLineCount] = '\0';


Commit: c471a4120b3d9e1fd60b2d2e417cbc129d451ccd
    https://github.com/scummvm/scummvm/commit/c471a4120b3d9e1fd60b2d2e417cbc129d451ccd
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-04-23T15:19:03-07:00

Commit Message:
GUI: Plug memory leak. CID 1003572

Changed paths:
    gui/ThemeParser.cpp



diff --git a/gui/ThemeParser.cpp b/gui/ThemeParser.cpp
index 9b45260..bd5b406 100644
--- a/gui/ThemeParser.cpp
+++ b/gui/ThemeParser.cpp
@@ -335,11 +335,15 @@ bool ThemeParser::parserCallback_drawstep(ParserNode *node) {
 
 	drawstep->drawingCall = getDrawingFunctionCallback(functionName);
 
-	if (drawstep->drawingCall == 0)
+	if (drawstep->drawingCall == 0) {
+		delete drawstep;
 		return parserError(functionName + " is not a valid drawing function name");
+	}
 
-	if (!parseDrawStep(node, drawstep, true))
+	if (!parseDrawStep(node, drawstep, true)) {
+		delete drawstep;
 		return false;
+	}
 
 	_theme->addDrawStep(getParentNode(node)->values["id"], *drawstep);
 	delete drawstep;


Commit: 3c0c6a5cb140b7ff84bbd5ba0fda6c5ddac68a09
    https://github.com/scummvm/scummvm/commit/3c0c6a5cb140b7ff84bbd5ba0fda6c5ddac68a09
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-04-23T15:23:31-07:00

Commit Message:
SWORD25: Plug memory leak. CID 1003589

Changed paths:
    engines/sword25/gfx/image/vectorimage.cpp



diff --git a/engines/sword25/gfx/image/vectorimage.cpp b/engines/sword25/gfx/image/vectorimage.cpp
index 81f4fc2..84c674f 100644
--- a/engines/sword25/gfx/image/vectorimage.cpp
+++ b/engines/sword25/gfx/image/vectorimage.cpp
@@ -190,6 +190,7 @@ Common::Rect CalculateBoundingBox(const VectorImageElement &vectorImageElement)
 		ArtVpath *vec = art_bez_path_to_vec(bez, 0.5);
 
 		if (vec[0].code == ART_END) {
+			free(vec);
 			continue;
 		} else {
 			x0 = x1 = vec[0].x;






More information about the Scummvm-git-logs mailing list