From cf141edd5242cba72bb43d5baf614005ffd50372 Mon Sep 17 00:00:00 2001 From: Moritz Grimm Date: Thu, 28 May 2015 16:12:38 +0200 Subject: [PATCH] Fix crash in error path --- src/playlist.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/playlist.c b/src/playlist.c index 9ef8342..6494e19 100644 --- a/src/playlist.c +++ b/src/playlist.c @@ -132,13 +132,13 @@ _playlist_run_program(struct playlist *pl) if (fgets(buf, (int)sizeof(buf), filep) == NULL) { int errnum = errno; - pclose(filep); - if (ferror(filep)) { log_alert("%s: output read error: %s", pl->filename, strerror(errnum)); + pclose(filep); exit(1); } + pclose(filep); /* No output (end of playlist.) */ return (NULL);