[CONPRO-1476] Fix memory leak in TCP server. 29/212729/1
authorSenthil Kumar G S <senthil.gs@samsung.com>
Wed, 14 Aug 2019 14:31:06 +0000 (20:01 +0530)
committerSudipto Bal <sudipto.bal@samsung.com>
Mon, 26 Aug 2019 09:17:26 +0000 (09:17 +0000)
commite8532631b6481623005e3642399db72cb4344431
treef2d7c35103095cf0243a79ada03502016361f171
parent8181b88c9eb6b2b45708e5e6c124ad2a79ff1b90
[CONPRO-1476] Fix memory leak in TCP server.

On starting TCP server, CAReceiveHandler thread is created but it is not destroyed when it is stopped.
Though the thread stops asynchronously, its handle which is stored in the thread pool is not removed and destroyed during stop
which causes memory leak to persist till stack termination.

Note: Cherry-picked the patch from https://github.sec.samsung.net/SES/SmartThingsThing/commit/c1d8cf83510f988fb4f8bf0e6b72cb18f618d4ec
Reviewed & Verified on current 1.2-rel codebase.

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/commit/ced355b7c49a76966fe4961ef93f53e470543c76
(cherry-picked from ced355b7c49a76966fe4961ef93f53e470543c76)

Change-Id: I8eeff40b22b57cc75717f8df3e34d1fbb1388c12
Signed-off-by: Senthil Kumar G S <senthil.gs@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
resource/csdk/connectivity/src/tcp_adapter/catcpserver.c