The program is published here (in the version with the normal NetServices library). What you should see is at the end the program tries to find out the available memory, but fails when trying to allocate 240 bytes (not with an error, it just stops).
When you replace NetServices with NetServiceMin+NtpClientMin, it works (at least it did when I checked last time). AFAIR it is just this program which mis-behaves, in my main program NetServices worked fine.
As for the memory leak, I'm not sure what the solution was. But I'm using NetServicesMin and NTPClientMin since it compiles faster, so I'm not sure whether it did go away with the newer mbed version or only when I removed the inheritance (I surely did nothing else).
AFAIK malloc() is supposed to return NULL when it cannot allocate the memory. But according to my testing it just seems to crash. If have written a small program with allocates 4 block with 8k each - and it doesn't seem to return from the last call: http://mbed.org/users/hlipka/programs/malloc_test
This makes it especially problematic to debug memory leaks (I suspect my code has one :(, since this nice library AvailableMemory doesn't work due to this...