From cd5e750a7fdfa0c2ac7904d24b7d8e5a06eff99a Mon Sep 17 00:00:00 2001 From: Littleboy Date: Mon, 13 Aug 2012 00:05:38 -0400 Subject: LASTEXPRESS: Fix analysis warnings --- engines/lastexpress/debug.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines/lastexpress/debug.cpp') diff --git a/engines/lastexpress/debug.cpp b/engines/lastexpress/debug.cpp index f89ad8b80d..55fb469da3 100644 --- a/engines/lastexpress/debug.cpp +++ b/engines/lastexpress/debug.cpp @@ -139,6 +139,9 @@ void Debugger::copyCommand(int argc, const char **argv) { for (int i = 0; i < _numParams; i++) { _commandParams[i] = (char *)malloc(strlen(argv[i]) + 1); + if (_commandParams[i] == NULL) + error("[Debugger::copyCommand] Cannot allocate memory for command parameters"); + memset(_commandParams[i], 0, strlen(argv[i]) + 1); strcpy(_commandParams[i], argv[i]); } -- cgit v1.2.3