From: Jihoon Kim Date: Wed, 29 Jan 2020 08:28:48 +0000 (+0900) Subject: Fix issues detected by static analysis tool X-Git-Tag: accepted/tizen/5.5/unified/20200130.113930~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0f971197e935e0ae8ed8cdec783b82f9d9a7bcce;p=platform%2Fcore%2Fuifw%2Fcapi-ui-sticker.git Fix issues detected by static analysis tool Change-Id: Ib804abcd232d0c31b373458605e4940f291f399b Signed-off-by: Jihoon Kim --- diff --git a/client/sticker_data.c b/client/sticker_data.c index fc4d716..decbfe3 100644 --- a/client/sticker_data.c +++ b/client/sticker_data.c @@ -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; } diff --git a/server/stickerd_data_manager.c b/server/stickerd_data_manager.c index b0922da..71203aa 100644 --- a/server/stickerd_data_manager.c +++ b/server/stickerd_data_manager.c @@ -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;