Comment 18 for bug 47044

Revision history for this message
Michael Vogt (mvo) wrote :

+ string argv0 = _config->Find(confvar.c_str(),DecompressProg.c_str());
Find() returns a string and expects two char*

+ Args[0] = argv0.c_str();
Args[] is a array of char*

- Args[0] = _config->Find(confvar.c_str(),DecompressProg.c_str()).c_str();
The problem with this construct is that _config->Find() returns a string and then the char* of that
string is used in Argv[0]. Because the string from Find() is not assigned it gets out of scope after
that line and the memory is freeded and the Args[0] char* is no longer valid.