LASTEXPRESS: Fix analysis warnings

This commit is contained in:
Littleboy 2012-08-13 00:05:38 -04:00
parent 4b05031042
commit cd5e750a7f
3 changed files with 10 additions and 0 deletions

View file

@ -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]);
}