From 6b06fdadbadac7874da63f0150b7cd8e75fb31d5 Mon Sep 17 00:00:00 2001 From: Philippe Coval Date: Thu, 21 Jul 2016 10:38:18 +0200 Subject: [PATCH] security: Improve with more specific error core and log of it This improvement has been suggested by Randeep Singh at : https://gerrit.iotivity.org/gerrit/#/c/9521/ Also reducing presence of "goto:" is always welcome ;) Change-Id: I2ca21c37105c530c92e2cfd4b6ae9e3cfbc06231 Origin: https://gerrit.iotivity.org/gerrit/#/c/9543/ Signed-off-by: Philippe Coval Reviewed-on: https://gerrit.iotivity.org/gerrit/9543 Tested-by: jenkins-iotivity Reviewed-by: Randeep Singh --- resource/csdk/security/src/amsmgr.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/resource/csdk/security/src/amsmgr.c b/resource/csdk/security/src/amsmgr.c index c208d3f..e348969 100644 --- a/resource/csdk/security/src/amsmgr.c +++ b/resource/csdk/security/src/amsmgr.c @@ -322,12 +322,9 @@ exit: OCStackResult UpdateAmsMgrContext(PEContext_t *context, const CAEndpoint_t *endpoint, const CARequestInfo_t *requestInfo) { - OCStackResult ret = OC_STACK_ERROR; - - if (!context->amsMgrContext) - { - goto exit; - } + OCStackResult ret = OC_STACK_INVALID_PARAM; + VERIFY_NON_NULL(TAG, context->amsMgrContext, ERROR); + ret = OC_STACK_ERROR; //The AmsMgr context endpoint and requestInfo will be free from , //AmsMgrAclReqCallback function -- 2.7.4