I could not replicate your bug. did you use leafpad as root? maybe it crashes if try to save to a root-owned file?