Perhaps you're missing a sufficient check for null pointer?
Qt Code:
  1. if (stringToReturn != NULL)
  2. {
  3. *stringToReturn = "foo";
  4. }
To copy to clipboard, switch view to plain text mode 
I'm sorry I'm afraid there's not much we can say about it with that amount of information. Just compile the app in debug mode and run it via gdb whenever you get such crashes you don't understand.