Memory leak in carz.pp (glob_name)
| Version | 0.73b |
| Solved in | 0.73c |
| File | carz.cpp |
| Owner | Marc Gueury |
| Platform | ALL |
| Impact on cars | NONE |
| Impact on portability | NONE |
Description:
Problem of memory allocation of the names in carz.cpp.
Variable glob_name is allocated and never removed.
[...]
static char *glob_name; // will hold name of each robot driver
(one at a time)
[...]
void RaceManager::ArgsInit( int argc, char* argv[] )
{
// Fill drivers[] array with driver names:
glob_name = new char[33]; // temporary storage for a driver's
name
[...]
Solution
Change of the definition of glob_name. The allocation is removed.
[...]
static char glob_name[33]; // will hold name of each robot driver
(one at a time)
[...]