aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/storedPlaylist.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/storedPlaylist.c b/src/storedPlaylist.c
index 322cb1b5b..32e22cc4a 100644
--- a/src/storedPlaylist.c
+++ b/src/storedPlaylist.c
@@ -461,11 +461,19 @@ int renameStoredPlaylist(int fd, const char *utf8from, const char *utf8to)
char *to;
int ret = 0;
- from = xstrdup(utf8pathToFsPathInStoredPlaylist(utf8from, fd));
+ from = utf8pathToFsPathInStoredPlaylist(utf8from, fd);
+ if (!from)
+ return -1;
+ from = xstrdup(from);
if (!from)
return -1;
- to = xstrdup(utf8pathToFsPathInStoredPlaylist(utf8to, fd));
+ to = utf8pathToFsPathInStoredPlaylist(utf8to, fd);
+ if (!to) {
+ free(from);
+ return -1;
+ }
+ to = xstrdup(to);
if (!to) {
free(from);
return -1;