There's a memory issue here. The serverConfigString will go out of scope when this method returns, and the char* could be pointing to something else or garbage data.

Can you return the QString instead and then pull the char* in the caller?