This is not really an explanation - the name "result" of a variable can not cause a crash. There's a different reason.

Somewhere in your code, a memory area is possibly overwritten, causing a crash when this area is accessed - for instance, the string "filesave error". This is why the crash does not happen always, but only sometimes.