Merge pull request #14740 from chrisswinchatt-arm/fix-netsocket-dynalloc
Fix 'netsocket: several dynamic allocation results not checked' (#14210)

add_event_listener in NetworkInterface now returns an error if the method fails. Previous attempts to add the event listener would attempt to use an unchecked standard dynamically allocated ns_list_* item.

In other cases, the dynamically allocated items will now be checked, and if unsuccessful, will return after cleaning up any outstanding issues.

TCPSocket::accept will now check that its own internally allocated new TCPSocket call will succeed, and if not, will clean up the stack resources. This should help when memory is low but an incoming connection requests a connection when the TCPSocket is listening.
ls
commit 0bbc3e225eae0c0be4c0024084eff02a7cf396a8
2 parents fa090ff + 053eb24
@Martin Kojtal Martin Kojtal authored on 9 Jun 2021
GitHub committed on 9 Jun 2021
Showing 7 changed files
View
connectivity/netsocket/include/netsocket/NetworkInterface.h
View
connectivity/netsocket/mbed_lib.json
View
connectivity/netsocket/source/NetworkInterface.cpp
View
connectivity/netsocket/source/TCPSocket.cpp
View
connectivity/netsocket/source/TLSSocketWrapper.cpp
View
connectivity/netsocket/source/nsapi_dns.cpp
View
tools/test/travis-ci/doxy-spellchecker/ignore.en.pws