Fix build warning 73/62373/1
authorMinje Ahn <minje.ahn@samsung.com>
Wed, 16 Mar 2016 00:04:13 +0000 (09:04 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Wed, 16 Mar 2016 00:04:13 +0000 (09:04 +0900)
Change-Id: I7c9bfb5b06ded6925506b96c50e166bfa05dd9a2
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
src/media-thumb-internal.c

index ad38f0e..73c72ce 100755 (executable)
@@ -1252,6 +1252,7 @@ int _media_thumb_video(const char *origin_path,
 
 static char* _media_thumb_mmc_get_path(uid_t uid)
 {
+       int ret = 0;
        char *result_psswd = NULL;
        struct group *grpinfo = NULL;
        if (uid == getuid()) {
@@ -1280,7 +1281,11 @@ static char* _media_thumb_mmc_get_path(uid_t uid)
                        thumb_err("UID [%d] does not belong to 'users' group!", uid);
                        return NULL;
                }
-               asprintf(&result_psswd, "%s/share/media/.thumb/mmc", userinfo->pw_dir);
+               ret = asprintf(&result_psswd, "%s/share/media/.thumb/mmc", userinfo->pw_dir);
+               if (ret == -1) {
+                       thumb_err("asprintf failed");
+                       return NULL;
+               }
        }
 
        return result_psswd;
@@ -1288,6 +1293,7 @@ static char* _media_thumb_mmc_get_path(uid_t uid)
 
 static char* _media_thumb_phone_get_path(uid_t uid)
 {
+       int ret = 0;
        char *result_psswd = NULL;
        struct group *grpinfo = NULL;
        if (uid == getuid()) {
@@ -1316,7 +1322,11 @@ static char* _media_thumb_phone_get_path(uid_t uid)
                        thumb_err("UID [%d] does not belong to 'users' group!", uid);
                        return NULL;
                }
-               asprintf(&result_psswd, "%s/share/media/.thumb/phone", userinfo->pw_dir);
+               ret = asprintf(&result_psswd, "%s/share/media/.thumb/phone", userinfo->pw_dir);
+               if (ret == -1) {
+                       thumb_err("asprintf failed");
+                       return NULL;
+               }
        }
 
        return result_psswd;