Unexpectedly quit? You would have to supply more info to know for sure if you are infected with a flashback trojan. But assuming it is from one of the trojans install the most recent java update (appropriate to your system which you didn't specify either) which advertises itself as being able to remove the trojans.
If you don't want to do that install then at least go to F_Secure's Flashback Removal Tool web page, download their Flashback trojan detection/removal tool, and follow the instructions you find there.
If you are running v10.6.8 or higher, installing this update will remove the variants of the flasshback trojan > Java for Mac OS X 10.6 Update 8
Restart your Mac after the update is installed then try Safari.