Fix the memory leak caused due to merge#667 in websocket_main
authorpradeep.ns <pradeep.ns@samsung.com>
Thu, 21 Sep 2017 10:04:10 +0000 (15:34 +0530)
committerpradeep.ns <pradeep.ns@samsung.com>
Thu, 21 Sep 2017 18:22:00 +0000 (23:52 +0530)
commite97a58507ff63896e6ddbfad1d9316d12a2eacaf
tree39bedb2810f313cc910300c26991f2f7b34bded5
parentf429391d23ee75c5fdcc130f5539aa59104c070e
Fix the memory leak caused due to merge#667 in websocket_main

1) websocket_main() allocates memory for input
2) calls websocket_client() api and passes input as argument
3) websocket_client returns without freeing the input due to error cases
4) websocket_main does not handle this case due to merge commit id #667

Fixed the same as follows
1) Removed the freeing of allocated memory for input inside websocket_client and websocket_server
2) Added pthred_join to wait until the child thread finishes
3) During exit of main thread, take care of releasing the allocated memory

Signed-off-by: pradeep.ns <pradeep.ns@samsung.com>
apps/examples/websocket/websocket_main.c