summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/ipc/media-thumb-ipc.c5
-rwxr-xr-xsrc/util/media-thumb-util.c6
2 files changed, 9 insertions, 2 deletions
diff --git a/src/ipc/media-thumb-ipc.c b/src/ipc/media-thumb-ipc.c
index add4ba3..53f3ba2 100755
--- a/src/ipc/media-thumb-ipc.c
+++ b/src/ipc/media-thumb-ipc.c
@@ -581,6 +581,8 @@ static char* _media_thumb_get_default_path(uid_t uid)
grpinfo = getgrnam("users");
if(grpinfo == NULL) {
thumb_err("getgrnam(users) returns NULL !");
+ if(result_psswd)
+ free(result_psswd);
return NULL;
}
}
@@ -682,8 +684,7 @@ int _media_thumb_process(thumbMsg *req_msg, thumbMsg *res_msg, uid_t uid)
thumb_path[strlen(thumb_path)] = '\0';
}
- if (g_file_test(thumb_path,
- G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR)) {
+ if (g_file_test(thumb_path, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR)) {
thumb_warn("thumb path already exists in file system.. remove the existed file");
_media_thumb_remove_file(thumb_path);
}
diff --git a/src/util/media-thumb-util.c b/src/util/media-thumb-util.c
index 485d13a..387a941 100755
--- a/src/util/media-thumb-util.c
+++ b/src/util/media-thumb-util.c
@@ -185,6 +185,8 @@ static char* _media_thumb_mmc_get_path(uid_t uid)
grpinfo = getgrnam("users");
if(grpinfo == NULL) {
thumb_err("getgrnam(users) returns NULL !");
+ if(result_psswd)
+ free(result_psswd);
return NULL;
}
}
@@ -223,6 +225,8 @@ static char* _media_thumb_phone_get_path(uid_t uid)
grpinfo = getgrnam("users");
if(grpinfo == NULL) {
thumb_err("getgrnam(users) returns NULL !");
+ if(result_psswd)
+ free(result_psswd);
return NULL;
}
}
@@ -283,6 +287,8 @@ int _media_thumb_get_hash_name(const char *file_full_path,
ret_len =
snprintf(thumb_hash_path, max_thumb_path - 1, "%s/.%s-%s.jpg",
thumb_dir, file_ext, hash_name);
+ if(thumb_dir)
+ free(thumb_dir);
if (ret_len < 0) {
thumb_err("Error when snprintf");
return -1;