aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJ. Alexander Treuman <jat@spatialrift.net>2007-05-16 20:35:13 +0000
committerJ. Alexander Treuman <jat@spatialrift.net>2007-05-16 20:35:13 +0000
commit92ff09881a5fa92c25bb768a7c58e341e0964f2f (patch)
tree89548d67008ba09e15b5e3995c916a5726dcffff /src
parenta2a101004b23e7e8676a6013261e0eae5b9f43f2 (diff)
downloadmpd-92ff09881a5fa92c25bb768a7c58e341e0964f2f.tar.gz
mpd-92ff09881a5fa92c25bb768a7c58e341e0964f2f.tar.xz
mpd-92ff09881a5fa92c25bb768a7c58e341e0964f2f.zip
Fail loading the playlist on errors mid-file. The same code is used for
playlistadd, playlistdelete, etc. and would've caused the playlist to be rewritten only up to the line with the error. git-svn-id: https://svn.musicpd.org/mpd/trunk@6133 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src')
-rw-r--r--src/storedPlaylist.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/storedPlaylist.c b/src/storedPlaylist.c
index b36bb10a7..75605313f 100644
--- a/src/storedPlaylist.c
+++ b/src/storedPlaylist.c
@@ -192,6 +192,8 @@ StoredPlaylist *loadStoredPlaylist(const char *utf8path, int fd)
ERROR("\"%s\" too long", temp);
free(temp);
+ freeStoredPlaylist(sp);
+ sp = NULL;
goto out;
}
free(temp);
@@ -211,6 +213,8 @@ StoredPlaylist *loadStoredPlaylist(const char *utf8path, int fd)
s, utf8path);
}
ERROR("line \"%s\" in playlist \"%s\" is too long\n", s, utf8path);
+ freeStoredPlaylist(sp);
+ sp = NULL;
goto out;
} else if (s[slength] != '\r')
slength++;