Fix issue detected by static analysis tool 06/232506/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Wed, 6 May 2020 05:25:57 +0000 (14:25 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Wed, 6 May 2020 05:25:57 +0000 (14:25 +0900)
Change-Id: Ic7e6a5d75b2ac90298a62ef22e2f8d581ccef53a
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
server/stickerd_data_manager.c

index 9e6455c..0e40774 100644 (file)
@@ -869,12 +869,15 @@ int stickerd_insert_sticker_info_by_json(GVariant *parameters, GVariant **reply_
             }
 
             sticker_info->app_id = strdup(app_id);
+            if (!sticker_info->app_id)
+                goto free_memory;
+
             sticker_info->type = _get_int_from_object(info_object, "type");
             if (sticker_info->type < 1)
                 goto free_memory;
 
             sticker_info->uri = _get_string_from_object(info_object, "uri");
-            if (!sticker_info->uri || sticker_info->uri[0] != '\0')
+            if (!sticker_info->uri || sticker_info->uri[0] == '\0')
                 goto free_memory;
 
             if (sticker_info->type == 1) {