Commit 13c17c3d authored by Max Kellermann's avatar Max Kellermann Committed by Eric Wong

check the result of fopen() in all code paths

The while() loop only checks for interrupted system calls (which woudl never happen if the signal mask were set up properly), but nobody checks if the fopen() actually succeeds. git-svn-id: https://svn.musicpd.org/mpd/trunk@7195 09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent 33e88ff8
......@@ -1349,6 +1349,11 @@ int savePlaylist(int fd, char *utf8file)
while (!(fp = fopen(path_max_tmp, "w")) && errno == EINTR);
if (fp == NULL) {
commandError(fd, ACK_ERROR_SYSTEM, "failed to create file");
return -1;
}
for (i = 0; i < playlist.length; i++) {
char tmp[MPD_PATH_MAX];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment