From 32fb290e423308e95d1c6974aa3c2805aaf008c7 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Thu, 15 Aug 2019 21:52:30 +0900 Subject: [PATCH] Check the result of the packet If the request is failed, the cmd of the packet is a negative error value. Change-Id: If5ef6e9c16719063cc89a5b0d5ab9bc8222d3b42 Signed-off-by: Hwankyu Jhun --- src/aul_comp_context.c | 7 +++++++ src/aul_comp_info.c | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/aul_comp_context.c b/src/aul_comp_context.c index ed86ac0..860cb52 100644 --- a/src/aul_comp_context.c +++ b/src/aul_comp_context.c @@ -366,6 +366,13 @@ API int aul_comp_context_usr_create(const char *comp_id, uid_t uid, return aul_error_convert(ret); } + if (pkt->cmd != APP_GET_INFO_OK) { + _E("Failed to get component info. error(%d)", pkt->cmd); + ret = pkt->cmd; + free(pkt); + return ret; + } + b = NULL; if (pkt->opt & AUL_SOCK_BUNDLE) { b = bundle_decode(pkt->data, pkt->len); diff --git a/src/aul_comp_info.c b/src/aul_comp_info.c index d956c4e..a9fc3de 100644 --- a/src/aul_comp_info.c +++ b/src/aul_comp_info.c @@ -901,6 +901,13 @@ API int aul_comp_info_usr_create(const char *comp_id, uid_t uid, return aul_error_convert(ret); } + if (pkt->cmd != APP_GET_INFO_OK) { + _E("Failed to get component info. error(%d)", pkt->cmd); + ret = pkt->cmd; + free(pkt); + return ret; + } + b = NULL; if (pkt->opt & AUL_SOCK_BUNDLE) { b = bundle_decode(pkt->data, pkt->len); -- 2.7.4