From: Minje Ahn Date: Mon, 7 Sep 2015 04:15:22 +0000 (+0900) Subject: Modify thumbnail creation and cancellation logic X-Git-Tag: submit/tizen/20150907.055530^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F06%2F47606%2F2;p=platform%2Fcore%2Fapi%2Fthumbnail-util.git Modify thumbnail creation and cancellation logic Change-Id: Ie8253983bab5c75bdfccf2d541bcb75ed9024b7d Signed-off-by: Minje Ahn --- diff --git a/src/thumbnail_util.c b/src/thumbnail_util.c index fc16c30..47df485 100755 --- a/src/thumbnail_util.c +++ b/src/thumbnail_util.c @@ -146,7 +146,7 @@ int thumbnail_util_cancel(thumbnail_h thumb, const char *request_id) if (_thumb != NULL && STRING_VALID(request_id)) { unsigned int request_id_integer = atoi(request_id); - ret = thumbnail_request_cancel_raw_data(request_id_integer, tzplatform_getuid(TZ_USER_NAME)); + ret = thumbnail_request_cancel_raw_data(request_id_integer); } else { thumbnail_util_error("INVALID_PARAMETER(0x%08x)", THUMBNAIL_UTIL_ERROR_INVALID_PARAMETER); ret = THUMBNAIL_UTIL_ERROR_INVALID_PARAMETER; @@ -161,7 +161,7 @@ int thumbnail_util_cancel_all(thumbnail_h thumb) thumbnail_s *_thumb = (thumbnail_s *)thumb; if (_thumb != NULL) { - ret = thumbnail_request_cancel_all(true, tzplatform_getuid(TZ_USER_NAME)); + ret = thumbnail_request_cancel_all(true); } else { thumbnail_util_error("INVALID_PARAMETER(0x%08x)", THUMBNAIL_UTIL_ERROR_INVALID_PARAMETER); ret = THUMBNAIL_UTIL_ERROR_INVALID_PARAMETER; diff --git a/test/thumbnail_util_test.c b/test/thumbnail_util_test.c index 4caecd7..6db9cfe 100755 --- a/test/thumbnail_util_test.c +++ b/test/thumbnail_util_test.c @@ -49,9 +49,12 @@ void __convert_i_to_a(unsigned int request_id, char **req_str) { char *buf = NULL; buf = malloc(MAX_SIZE * sizeof(char)); - snprintf(buf, MAX_SIZE, "%d", request_id); - *req_str = strndup(buf, strlen(buf)); - SAFE_FREE(buf); + + if (buf != NULL) { + snprintf(buf, MAX_SIZE, "%d", request_id); + *req_str = strndup(buf, strlen(buf)); + SAFE_FREE(buf); + } } gboolean extract_thumbnail_start(gpointer data)