aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/decode.c7
-rw-r--r--src/ls.c2
-rw-r--r--src/playlist.c4
3 files changed, 9 insertions, 4 deletions
diff --git a/src/decode.c b/src/decode.c
index 544880f57..db780dffe 100644
--- a/src/decode.c
+++ b/src/decode.c
@@ -261,11 +261,16 @@ static void decodeStart(PlayerControl * pc, OutputBuffer * cb, DecoderControl *
InputStream inStream;
InputPlugin * plugin = NULL;
char * path;
+ char * relativePath;
if(isRemoteUrl(pc->utf8url)) {
path = utf8StrToLatin1Dup(pc->utf8url);
}
- else path = strdup(rmp2amp(utf8ToFsCharset(pc->utf8url)));
+ else {
+ relativePath = utf8ToFsCharset(pc->utf8url);
+ path = strdup(rmp2amp(relativePath));
+ free(relativePath);
+ }
if(!path) {
dc->error = DECODE_ERROR_FILE;
diff --git a/src/ls.c b/src/ls.c
index dc36a888a..2c09f8b3a 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -111,7 +111,7 @@ int lsPlaylists(FILE * fp, char * utf8path) {
char s[MAXPATHLEN+1];
List * list = NULL;
ListNode * node = NULL;
- char * path = strdup(utf8ToFsCharset(utf8path));
+ char * path = utf8ToFsCharset(utf8path);
char * actualPath = rpp2app(path);
int actlen = strlen(actualPath)+1;
int maxlen = MAXPATHLEN-actlen;
diff --git a/src/playlist.c b/src/playlist.c
index 32a191bee..cf7ff9759 100644
--- a/src/playlist.c
+++ b/src/playlist.c
@@ -1310,7 +1310,7 @@ int savePlaylist(FILE * fp, char * utf8file) {
return -1;
}
- file = strdup(utf8ToFsCharset(utf8file));
+ file = utf8ToFsCharset(utf8file);
rfile = malloc(strlen(file)+strlen(".")+
strlen(PLAYLIST_FILE_SUFFIX)+1);
@@ -1415,7 +1415,7 @@ static int PlaylistIterFunc(FILE * fp, char * utf8file, void (*IterFunc)(FILE *f
FILE * fileP;
char s[MAXPATHLEN+1];
int slength = 0;
- char * temp = strdup(utf8ToFsCharset(utf8file));
+ char * temp = utf8ToFsCharset(utf8file);
char * rfile = malloc(strlen(temp)+strlen(".")+
strlen(PLAYLIST_FILE_SUFFIX)+1);
char * actualFile;