diff --git a/services/init/init_service_manager.c b/services/init/init_service_manager.c index 15b7008a4..10e437c10 100755 --- a/services/init/init_service_manager.c +++ b/services/init/init_service_manager.c @@ -321,6 +321,8 @@ static int GetUid(cJSON *json, uid_t *uid) *uid = DecodeUid(str); } else if (cJSON_IsNumber(json)) { *uid = (uid_t)cJSON_GetNumberValue(json); + } else { + *uid = (uid_t)(-1); } INIT_CHECK_RETURN_VALUE(*uid != (uid_t)(-1), SERVICE_FAILURE); return SERVICE_SUCCESS; @@ -967,12 +969,12 @@ void ParseAllServices(const cJSON *fileRoot) cJSON *curItem = cJSON_GetArrayItem(serviceArr, i); int ret = GetStringItem(curItem, "name", serviceName, MAX_SERVICE_NAME); if (ret != 0) { - INIT_LOGE("Failed to get service name %s", serviceName); + INIT_LOGE("Failed to get service name"); continue; } Service *service = GetServiceByName(serviceName); if (service != NULL) { - INIT_LOGE("Service name %s has been exist", serviceName); + INIT_LOGE("Service \' %s \' already exist", serviceName); continue; } service = AddService(serviceName); diff --git a/services/init/standard/fd_holder_service.c b/services/init/standard/fd_holder_service.c index 53c4a03ce..71a6bf90c 100644 --- a/services/init/standard/fd_holder_service.c +++ b/services/init/standard/fd_holder_service.c @@ -222,8 +222,8 @@ static void HandlerFdHolder(int sock) } else { INIT_LOGE("Unexpected action: %s", action); } - FreeFds(fds); CloseFds(fds, fdCount); + FreeFds(fds); FreeStringVector(msg, msgCount); } diff --git a/services/param/trigger/trigger_checker.c b/services/param/trigger/trigger_checker.c index 21599366a..268efb49b 100644 --- a/services/param/trigger/trigger_checker.c +++ b/services/param/trigger/trigger_checker.c @@ -278,7 +278,7 @@ int ConvertInfixToPrefix(const char *condition, char *prefix, uint32_t prefixLen uint32_t prefixIndex = 0; size_t conditionLen = strlen(condition); LogicCalculator calculator; - CalculatorInit(&calculator, MAX_CALC_PARAM, 1, 0); + PARAM_CHECK(CalculatorInit(&calculator, MAX_CALC_PARAM, 1, 0) == 0, return -1, "Failed to init calculator"); while (curr < conditionLen) { if (condition[curr] == ')') {