aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJose Bollo <jose.bollo@iot.bzh>2020-01-22 10:05:23 +0100
committerJose Bollo <jose.bollo@iot.bzh>2020-01-22 10:05:23 +0100
commitc0adba3e6e8527c67d4d7699c9a8d8248f07b843 (patch)
tree97e7f1891d2997e071963127ec56dbecbd5a56cd
parentd6b295b89882b61ddefc4bed4b6f8dad0181d170 (diff)
Also fix a memory leak. Bug-AGL: SPEC-3116 Change-Id: Id4c51770d06f8984b60b9b25f13d6dcf5616b2ad Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
-rw-r--r--src/window_manager.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/window_manager.cpp b/src/window_manager.cpp
index dcaf636..7fc47c3 100644
--- a/src/window_manager.cpp
+++ b/src/window_manager.cpp
@@ -493,6 +493,7 @@ bool WindowManager::api_subscribe(afb_req_t req, EventType event_id)
if(event_id < Event_Val_Min || event_id > Event_Val_Max)
{
HMI_ERROR("not defined in Window Manager", event_id);
+ free(appid);
return ret;
}
HMI_INFO("%s subscribe %s : %d", appid, kListEventName[event_id].c_str(), event_id);
@@ -509,17 +510,17 @@ bool WindowManager::api_subscribe(afb_req_t req, EventType event_id)
else if(appid)
{
string id = appid;
- free(appid);
if(!g_app_list.contains(id))
{
g_app_list.addClient(id);
}
- g_app_list.lookUpClient(id)->subscribe(req, kListEventName[event_id]);
+ ret = g_app_list.lookUpClient(id)->subscribe(req, kListEventName[event_id]);
}
else
{
HMI_ERROR("appid is not set");
}
+ free(appid);
return ret;
}