arduino/Arduino — pull request #1150 by richard-sim (2012-12-03 07:59:52+00:00)
Title: Fix for Issue 933: Memory leak in Ethernet.cpp (allocating DHCP object)

* Fixes memory leak when calling Ethernet.begin() multiple times
* Ensure the UDP socket is closed before trying to open it

As per discussion here: [Issue 933](http://code.google.com/p/arduino/issues/detail?id=933)

The static solution was chosen as this has several benefits:
* Does not require refactoring DhcpClient to include a destructor, which may have had unintended knock-ons.
* Maintains the existing behaviour while avoiding the issue.
* Avoids pulling in operator new() when it may not otherwise be pulled in.
* Minimal changes were required.