From f320681b92d814842a9f2d28a8384b9b764cc29b Mon Sep 17 00:00:00 2001 From: Minje Ahn Date: Mon, 7 Sep 2015 13:15:22 +0900 Subject: [PATCH] Modify thumbnail creation and cancellation logic Change-Id: Ie8253983bab5c75bdfccf2d541bcb75ed9024b7d Signed-off-by: Minje Ahn --- src/thumbnail_util.c | 4 ++-- test/thumbnail_util_test.c | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) 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) -- 2.7.4