if (sticker_data->type == STICKER_DATA_URI_LOCAL_PATH) {
len = strlen(STICKER_DIRECTORY) + strlen(sticker_data->app_id) + strlen(sticker_data->uri) + 2;
conv_path = (char *)calloc(len, sizeof(char));
- snprintf(conv_path, len, "%s/%s%s", STICKER_DIRECTORY, sticker_data->app_id, sticker_data->uri);
+ if (conv_path)
+ snprintf(conv_path, len, "%s/%s%s", STICKER_DIRECTORY, sticker_data->app_id, sticker_data->uri);
} else
conv_path = strdup(sticker_data->uri);
- if (strcmp(conv_path, origin_data->uri) != 0) {
+ if (conv_path && (strcmp(conv_path, origin_data->uri) != 0)) {
LOGD("origin_uri : %s, new_uri : %s", origin_data->uri, conv_path);
int is_exist = 0;
ret = _send_sync_message(gdbus_connection, g_variant_new("(s)", sticker_data->uri), &reply, "check_file_exists");
if (sticker_data->thumbnail) {
int len = strlen(STICKER_DIRECTORY) + strlen(sticker_data->app_id) + strlen(sticker_data->thumbnail) + 2;
char *conv_path = (char *)calloc(len, sizeof(char));
- snprintf(conv_path, len, "%s/%s%s", STICKER_DIRECTORY, sticker_data->app_id, sticker_data->thumbnail);
- if (strcmp(conv_path, origin_data->thumbnail) != 0) {
- LOGD("origin_thumbnail : %s, new_thumbnail : %s", origin_data->thumbnail, conv_path);
- ret = _send_sync_message(gdbus_connection, g_variant_new("(iss)", sticker_data->sticker_info_id, sticker_data->app_id, sticker_data->thumbnail), &reply, "update_sticker_thumbnail");
- if (ret != STICKER_CLIENT_ERROR_NONE) {
- LOGE("failed to update sticker thumbnail");
- free(conv_path);
- goto cleanup;
+ if (conv_path) {
+ snprintf(conv_path, len, "%s/%s%s", STICKER_DIRECTORY, sticker_data->app_id, sticker_data->thumbnail);
+ if (strcmp(conv_path, origin_data->thumbnail) != 0)
+ {
+ LOGD("origin_thumbnail : %s, new_thumbnail : %s", origin_data->thumbnail, conv_path);
+ ret = _send_sync_message(gdbus_connection, g_variant_new("(iss)", sticker_data->sticker_info_id, sticker_data->app_id, sticker_data->thumbnail), &reply, "update_sticker_thumbnail");
+ if (ret != STICKER_CLIENT_ERROR_NONE)
+ {
+ LOGE("failed to update sticker thumbnail");
+ free(conv_path);
+ goto cleanup;
+ }
}
+ free(conv_path);
}
- free(conv_path);
}
if (sticker_data->description && strcmp(sticker_data->description, origin_data->description) != 0) {