Some svace issues fixed
[platform/upstream/iotivity.git] / resource / csdk / security / provisioning / src / cloud / aclinvite.c
index 618734e..31eb586 100644 (file)
@@ -1,3 +1,22 @@
+/* *****************************************************************
+ *
+ * Copyright 2016 Samsung Electronics All Rights Reserved.
+ *
+ *
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * *****************************************************************/
 #include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -12,7 +31,7 @@
 #include "pmutility.h"
 #include "cacommonutil.h"
 
-#define TAG "CLOUD-ACL-INVITE"
+#define TAG "OIC_CLOUD_ACL_INVITE"
 
 /**
  * This helper function parses "name" : { "gid":[], "mid":[] } payload
@@ -135,12 +154,7 @@ static OCStackResult handleAclGetInvitationResponse(void *ctx, void **data, OCCl
     }
 
     *data = answer;
-
 exit:
-    if (result != OC_STACK_OK)
-    {
-        OICFree(answer);
-    }
     return result;
 }
 
@@ -204,6 +218,7 @@ OCStackResult OCCloudAclInviteUser(void* ctx,
     OCRepPayload *payload = OCRepPayloadCreate();
     if (!payload)
     {
+        OICFree(cbData.context);
         return OC_STACK_NO_MEMORY;
     }