You might think if a cash machine malfunctions then it is tough on the banks but a windfall for the customer.
Recently dozens of cash machines in Sydney, Australia, were accidentally overpaying customers so if you take money under these circumstances, what is the correct course of action, legally and morally?
Free cash. It sounds too good to be true.
When word got around the streets that some cash machines were giving out more money than customers were entitled to, queues began to form and people took advantage.
There was talk, according to one witness, that they were giving out "free money".
The bank later explained that an error had prevented the machines from properly identifying customer accounts, but that all transactions were correctly recorded and the bank would be pursuing the money.
Is it an offence to keep cash accidentally dispensed from a cash machine?
In England and Wales, it's pretty clear - it's not your money, says Mark Haslam, a criminal defence lawyer at BCL Burton Copeland in London.
"The only issue is what's going to be debited from your account, so if you ask for £10, they give you £100 and they debit £100, then it's yours.
"But if it's clearly a malfunction and it's dishing out money [without deducting it], and people come from miles around because word gets around quickly, then you're helping yourself knowingly and that's theft."
If you happen to be passing and someone tells you it's handing out £200 every time, then it's clearly theft because there's knowledge and intent, and the intent could be proved.
"So the best course of action in terms of the law is to report it straightaway to the bank," says Haslam. "It's the only way you can preserve your position, but if you sit on it and wait for them to find you, then it's a lot weaker."
The law concerned is more likely to be theft rather than fraud, he says, because you've taken money to which you are not entitled.
The 1968 Theft Act says: "A person is guilty of theft if he dishonestly appropriates property belonging to another with the intention of permanently depriving the other of it."
In Scotland, the same principle applies under common law theft, says a spokeswoman for the Law Society of Scotland.
UK banks don't always take a hard line.
Dozens of people who took advantage of a cash machine in Dundee paying out double the requested amount in January were told by the machine's operator that they would not have to return the extra money, although it was up to individuals' consciences.
Our advice is simple, says Brian Mairs, a spokesman for the British Bankers' Association. "If an ATM dispenses money to you in error, you should take it into the branch as soon as possible. Taking money that is not yours is a punishable crime.
"Banks have invested heavily in recent years in ensuring the security of customers' money and the integrity of ATMs. There have been instances where an ATM has malfunctioned and the bank has written off the loss, but it would be wrong to assume that they will do so every time."
Morally speaking you are doing something wrong, stealing, if you take it, says Simon Rippon of the Oxford Uehiro Centre for Practical Ethics. The interesting question is whether this kind of stealing is more excusable than stealing from an individual.
Someone who takes cash from a malfunctioning cash machine is judged more leniently than someone else who takes cash that is accidentally left behind by the person in front of them, and who fails to inform that person of their loss, he says.
"The 18th Century Scottish philosopher Adam Smith, who is best known for his 'invisible hand' economic theory, provided a moral theory in his book The Theory of Moral Sentiments that can very naturally explain the distinction between these cases. On Smith's theory, moral judgements arise out of our sympathy with the feelings of others."