[IOT-2803] Remove all roles if credid is zero 27/22827/2
authorAlex Kelley <alexke@microsoft.com>
Fri, 13 Oct 2017 16:59:46 +0000 (09:59 -0700)
committerRandeep Singh <randeep.s@samsung.com>
Mon, 16 Oct 2017 11:47:58 +0000 (11:47 +0000)
Change-Id: I6905b2c836d61d05b20a47b43c9ce777c2af0f61
Signed-off-by: Alex Kelley <alexke@microsoft.com>
resource/csdk/security/src/rolesresource.c

index a60a5fc..dfa197b 100644 (file)
@@ -978,7 +978,10 @@ static OCEntityHandlerResult HandleDeleteRequest(OCEntityHandlerRequest *ehReque
                 LL_DELETE(entry->chains, curr1);
                 FreeRoleCertChain(curr1);
                 ehRet = OC_EH_RESOURCE_DELETED;
-                break;
+                if (0 != credId)
+                {
+                    break;
+                }
             }
         }
     }