[Scummvm-cvs-logs] scummvm master -> aded46f08b476ee1caccc070b8495cafe7094b47

eriktorbjorn eriktorbjorn at telia.com
Sun Feb 28 15:24:11 CET 2016


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

Summary:
bf5208dd3d GUI: Fix two leaks in predictive dialog
aded46f08b GUI: Don't crash on empty dictionary in predictive dialog


Commit: bf5208dd3df18e7ff05c4e18b3f03c00baf22238
    https://github.com/scummvm/scummvm/commit/bf5208dd3df18e7ff05c4e18b3f03c00baf22238
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2016-02-28T15:04:11+01:00

Commit Message:
GUI: Fix two leaks in predictive dialog

Changed paths:
    gui/predictivedialog.cpp
    gui/predictivedialog.h



diff --git a/gui/predictivedialog.cpp b/gui/predictivedialog.cpp
index 6ff1026..d9dd573 100644
--- a/gui/predictivedialog.cpp
+++ b/gui/predictivedialog.cpp
@@ -981,6 +981,7 @@ void PredictiveDialog::loadAllDictionary(Dict &dict) {
 		Common::File *inFile = new Common::File();
 		if (!inFile->open(ConfMan.get(dict.nameDict))) {
 			warning("Predictive Dialog: cannot read file: %s", dict.defaultFilename.c_str());
+			delete inFile;
 			return;
 		}
 		loadDictionary(inFile, dict);
diff --git a/gui/predictivedialog.h b/gui/predictivedialog.h
index 37c80a2..4c167c3 100644
--- a/gui/predictivedialog.h
+++ b/gui/predictivedialog.h
@@ -85,6 +85,7 @@ private:
 	struct Dict {
 		Dict() : dictLine(nullptr), dictText(nullptr), dictActLine(nullptr),
 		         dictLineCount(0), dictTextSize(0) {}
+		~Dict() { free(dictText); }
 		char **dictLine;
 		char *dictText;
 		char *dictActLine; // using only for united dict...


Commit: aded46f08b476ee1caccc070b8495cafe7094b47
    https://github.com/scummvm/scummvm/commit/aded46f08b476ee1caccc070b8495cafe7094b47
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2016-02-28T15:23:24+01:00

Commit Message:
GUI: Don't crash on empty dictionary in predictive dialog

Changed paths:
    gui/predictivedialog.cpp



diff --git a/gui/predictivedialog.cpp b/gui/predictivedialog.cpp
index d9dd573..9557da1 100644
--- a/gui/predictivedialog.cpp
+++ b/gui/predictivedialog.cpp
@@ -724,6 +724,10 @@ int PredictiveDialog::binarySearch(const char *const *const dictLine, const Comm
 }
 
 bool PredictiveDialog::matchWord() {
+	// If there is no dictionary, then there is no match.
+	if (_unitedDict.dictLineCount <= 0)
+		return false;
+
 	// If no text has been entered, then there is no match.
 	if (_currentCode.empty())
 		return false;






More information about the Scummvm-git-logs mailing list