[M108 Migration] Fix memory leak in intercept request 84/289384/2
authorfeifei08.liu <feifei08.liu@samsung.com>
Tue, 7 Mar 2023 02:04:40 +0000 (10:04 +0800)
committerBot Blink <blinkbot@samsung.com>
Mon, 13 Mar 2023 07:10:34 +0000 (07:10 +0000)
commitf3125342a50f093cc9dce271f1f587e43ad5973c
tree5c99d454427d3805ecab3b593a792996a787b52b
parenta99408dd20ef1ad6fafca0258c61405e2e2ff61f
[M108 Migration] Fix memory leak in intercept request

In TV plus test case, HBB team found some memory from ewk intercept
request interface have never been released.
Test case: Repeatly raise Tv plus and exit.

hbbtv_app process never exit, each time raising Tv plus, many ewk intercept
request instances and ProxyingURLLoaderEfl instances will be leaked:
1. In ProxyingURLLoaderFactoryEfl::CreateLoaderAndStart,
   when intercept_request->is_ignored(),
   the new _Ewk_Intercept_Request will be leak;
2. In ProxyingURLLoaderFactoryEfl::CreateLoaderAndStart,
   after creating, the created ProxyingURLLoaderEfl never dtor;
3. In _Ewk_Intercept_Request::put_chunk, when delegate_ is null,
   the function input "char* data" will be leaked.
4. In ProxyingURLLoaderEfl::PutChunk, the instance dose not emplace
   the input data memory nor delete it.

Reference:
- https://review.tizen.org/gerrit/283460/

Change-Id: Icb5d95ea5e201e9f8beb24914b14822b2e99957e
Signed-off-by: feifei08.liu <feifei08.liu@samsung.com>
tizen_src/ewk/efl_integration/browser/network_service/proxying_url_loader_efl.cc
tizen_src/ewk/efl_integration/private/ewk_intercept_request_private.cc