[Scummvm-devel] [Scummvm-cvs-logs] SF.net SVN: scummvm:[55232] scummvm/trunk/engines/parallaction/parser_br. cpp
peres
peres at scummvm.org
Fri Jan 14 01:21:22 CET 2011
> Modified: scummvm/trunk/engines/parallaction/parser_br.cpp
> ===================================================================
> --- scummvm/trunk/engines/parallaction/parser_br.cpp 2011-01-13 20:06:23 UTC (rev 55231)
> +++ scummvm/trunk/engines/parallaction/parser_br.cpp 2011-01-13 21:58:54 UTC (rev 55232)
> @@ -786,7 +786,7 @@
> _vm->_location._slideText[1] = _tokens[2];
> } else
> if (!scumm_stricmp(_tokens[0], "location")) {
> - data->_doorLocation = strdup(_tokens[1]);
> + data->_doorLocation = _tokens[1];
> } else
I'd say this can't work. _tokens is overwritten whenever a line is parsed out of the file, so a copy is necessary.
If you want to plug the leak, then free the string in the destructor instead.
More information about the Scummvm-devel
mailing list