static char* _media_thumb_mmc_get_path(uid_t uid)
{
+ int ret = 0;
char *result_psswd = NULL;
struct group *grpinfo = NULL;
if (uid == getuid()) {
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;
static char* _media_thumb_phone_get_path(uid_t uid)
{
+ int ret = 0;
char *result_psswd = NULL;
struct group *grpinfo = NULL;
if (uid == getuid()) {
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;