I dunno...I'm too cheap to just toss something like that if I already have it. I wouldn't have bought it...but if I found it in my basement or something, I'd check it out. Is it cracked? Does it have calcium deposits inside the tube, or are they all on the outside? If not cracked and if clean inside, maybe delve a bit deeper.
It looks like its supposed to be fully sealed and submersible. I wouldn't trust that feature anymore; mount it with the control end exposed at the water surface using a bracket. At the very least, drop it underwater (not plugged in) and check it a day later for moisture visible inside. If it's wet inside, it might still be fine to use (after it dries out) as long as the top is not submerged. It wasn't that long ago that all heaters required to be mounted that way, as they were not sealed. For a long time in Canada, after submersible heaters became available, they were still required to be marked with a water level line beyond which you weren't supposed to mount them according to the rules.
Crusty calcium deposits on the outside of the tube can be cleaned up with some vinegar or CLR and some elbow grease.
I also wouldn't trust it in too small of a tank. Stuck thermostats and boiled fish are less likely if the heater wattage is just barely able to heat the tank adequately, usually 2 - 5 watts per gallon depending upon ambient room temperature and how warm you want your tank. If you put a heater capable of heating 100 gallons into a 10 gallon tank, and if it is in good working order, it will work just fine; it'll just switch on, heat the water quickly and then switch off after only a short period of time. This constant on/off/on/off is tough on thermostats...and if the thermostat goes bad and gets stuck "on", the high wattage will very quickly overheat the tank to dangerous levels. If the heater is just barely big enough for the tank it may not be capable of overheating the tank too badly, and it will take much longer to do so even if it can.
Finally...and I know many people ignore this or think it's overkill...I always unplug a heater before touching the water with my hands to do any work in the tank. If the water in the tank is energized by a broken or leaky heater, the fish will likely look fine...but if you are grounded, perhaps by touching a grounded metal object or standing on dampness...and you touch that water you will get a jolt. Any time electrical components like heaters, power filters, etc. are used in and around aquariums, they should always be plugged into a GFCI-protected circuit. If you have a GFCI breaker in your electrical panel, that's ideal; but you get identical protection from a GFCI receptacle mounted in the wall where you plug your aquarium stuff in, or can even get a GFCI-protected powerbar for the same purpose. GFCI protection senses dangerous voltage and shuts off so fast that you don't get shocked.
The fact that you got this at a thrift store sort of implies that you are a cheapskate like me...so you don't need to automatically throw away this heater without at least cleaning it up, examining it carefully and trying it out. It might continue to work for years...or it might crap out tomorrow...or it might not work at all...but at least you'll know.