Fix issues detected by static analysis tool 92/223392/2
authorJihoon Kim <jihoon48.kim@samsung.com>
Wed, 29 Jan 2020 08:28:48 +0000 (17:28 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Wed, 29 Jan 2020 08:58:32 +0000 (17:58 +0900)
Change-Id: Ib804abcd232d0c31b373458605e4940f291f399b
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
client/sticker_data.c
server/stickerd_data_manager.c

index fc4d716..decbfe3 100644 (file)
@@ -118,8 +118,7 @@ EXPORT_API int sticker_data_create(sticker_data_h *data_handle)
     *data_handle = data_struct;
 
 cleanup:
-    if (app_id)
-        free(app_id);
+    free(app_id);
 
     return ret;
 }
index b0922da..71203aa 100644 (file)
@@ -921,6 +921,28 @@ int stickerd_get_sticker_info(GVariant *parameters, GVariant **reply_body)
     ret = stickerd_db_get_sticker_info_by_record_id(record_id, sticker_info);
     if (ret != STICKERD_SERVER_ERROR_NONE) {
         LOGE("Failed to get sticker info");
+
+        if (sticker_info->app_id)
+            free(sticker_info->app_id);
+
+        if (sticker_info->uri)
+            free(sticker_info->uri);
+
+        if (sticker_info->thumbnail)
+            free(sticker_info->thumbnail);
+
+        if (sticker_info->keyword)
+            free(sticker_info->keyword);
+
+        if (sticker_info->group)
+            free(sticker_info->group);
+
+        if (sticker_info->description)
+            free(sticker_info->description);
+
+        if (sticker_info->date)
+            free(sticker_info->date);
+
         free(sticker_info);
         sticker_info = NULL;
         return STICKERD_SERVER_ERROR_OPERATION_FAILED;