security: Declare variables before goto
authorPhilippe Coval <philippe.coval@osg.samsung.com>
Fri, 30 Jun 2017 11:09:46 +0000 (13:09 +0200)
committerDan Mihai <Daniel.Mihai@microsoft.com>
Thu, 13 Jul 2017 14:43:24 +0000 (14:43 +0000)
Change-Id: Ifce52dd9207dfdc02f66990e20acc14ef3a0f398
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21169
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
resource/csdk/security/src/aclresource.c

index 882520e..17b4aa0 100644 (file)
@@ -2092,6 +2092,8 @@ bool IsValidAclAccessForSubOwner(const OicUuid_t* uuid, const uint8_t *cborPaylo
 {
     bool retValue = false;
     OicSecAcl_t* acl = NULL;
+    OicSecAce_t* ace = NULL;
+    OicSecAce_t* tempAce = NULL;
 
     VERIFY_NOT_NULL(TAG, uuid, ERROR);
     VERIFY_NOT_NULL(TAG, cborPayload, ERROR);
@@ -2100,8 +2102,6 @@ bool IsValidAclAccessForSubOwner(const OicUuid_t* uuid, const uint8_t *cborPaylo
     acl = CBORPayloadToAcl(cborPayload, size);
     VERIFY_NOT_NULL(TAG, acl, ERROR);
 
-    OicSecAce_t* ace = NULL;
-    OicSecAce_t* tempAce = NULL;
     LL_FOREACH_SAFE(acl->aces, ace, tempAce)
     {
         OicSecRsrc_t* rsrc = NULL;