Modify thumbnail creation and cancellation logic 06/47606/2 tizen_3.0.m1_mobile tizen_3.0.m1_tv accepted/tizen/mobile/20150907.084923 accepted/tizen/tv/20150907.084955 accepted/tizen/wearable/20150907.084939 submit/tizen/20150907.055530 submit/tizen_common/20151023.083358 submit/tizen_common/20151026.085049 tizen_3.0.m1_mobile_release tizen_3.0.m1_tv_release tizen_3.0.m2.a1_mobile_release tizen_3.0.m2.a1_tv_release
authorMinje Ahn <minje.ahn@samsung.com>
Mon, 7 Sep 2015 04:15:22 +0000 (13:15 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Mon, 7 Sep 2015 05:08:19 +0000 (14:08 +0900)
Change-Id: Ie8253983bab5c75bdfccf2d541bcb75ed9024b7d
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
src/thumbnail_util.c
test/thumbnail_util_test.c

index fc16c30..47df485 100755 (executable)
@@ -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;
index 4caecd7..6db9cfe 100755 (executable)
@@ -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)