summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaeho Lee <jaeho81.lee@samsung.com>2013-05-15 16:46:43 +0900
committerJaeho Lee <jaeho81.lee@samsung.com>2013-05-15 16:48:03 +0900
commit43f99d61dbfb693ebad97ccb22f2f7352c102617 (patch)
treed9cc9e61b34e05f2ef6da5cdf1fb8e633923b9fc
parentdfcf9f5dc6b2515eb3cebcd0e392beeaeb3223e2 (diff)
downloadapp-svc-43f99d61dbfb693ebad97ccb22f2f7352c102617.tar.gz
app-svc-43f99d61dbfb693ebad97ccb22f2f7352c102617.tar.bz2
app-svc-43f99d61dbfb693ebad97ccb22f2f7352c102617.zip
fixed resolution bug
Signed-off-by: Jaeho Lee <jaeho81.lee@samsung.com>
-rwxr-xr-xsrc/appsvc.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/appsvc.c b/src/appsvc.c
index f4f5713..aed2846 100755
--- a/src/appsvc.c
+++ b/src/appsvc.c
@@ -230,21 +230,21 @@ static int __get_resolve_info(bundle *b, appsvc_resolve_info_t *info)
if(info->uri) {
if(strncmp(info->uri,"/",1) == 0){
if(!info->mime) {
- info->mime = malloc(MAX_MIME_STR_SIZE);
+ info->origin_mime = info->mime = malloc(MAX_MIME_STR_SIZE);
aul_get_mime_from_file(info->uri, info->mime, MAX_MIME_STR_SIZE);
info->mime_set = 1;
}
info->uri = NULL;
} else if(strncmp(info->uri,"file:/",6)==0){
if(!info->mime) {
- info->mime = malloc(MAX_MIME_STR_SIZE);
+ info->origin_mime = info->mime = malloc(MAX_MIME_STR_SIZE);
aul_get_mime_from_file(&info->uri[5], info->mime, MAX_MIME_STR_SIZE);
info->mime_set = 1;
}
info->uri = NULL;
} else if(strncmp(info->uri,"file:///",8) == 0){
if(!info->mime) {
- info->mime = malloc(MAX_MIME_STR_SIZE);
+ info->origin_mime = info->mime = malloc(MAX_MIME_STR_SIZE);
aul_get_mime_from_file(&info->uri[7], info->mime, MAX_MIME_STR_SIZE);
info->mime_set = 1;
}
@@ -298,8 +298,7 @@ static int __get_resolve_info(bundle *b, appsvc_resolve_info_t *info)
strncpy(info->s_type, "%", MAX_LOCAL_BUFSZ-1);
}
- if(!info->mime_set)
- info->mime = malloc(MAX_MIME_STR_SIZE);
+ info->mime = malloc(MAX_MIME_STR_SIZE);
snprintf(info->mime, MAX_MIME_STR_SIZE-1, "%s/%s", info->m_type, info->s_type);
}
@@ -320,6 +319,8 @@ static int __free_resolve_info_data(appsvc_resolve_info_t *info)
free(info->s_type);
if (info->uri_r_info)
free(info->uri_r_info);
+ if (info->mime_set)
+ free(info->origin_mime);
return 0;
}