From de7ab1547f5db8bb1d3694022f308f0a82d01002 Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Thu, 2 Sep 2021 00:12:18 +0200 Subject: [PATCH] [library] Remove needless stat() in scan_playlist() Fixes time-of-check time-of-use warning from CodeQL --- src/library/filescanner_playlist.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/library/filescanner_playlist.c b/src/library/filescanner_playlist.c index cb985838..ae040409 100644 --- a/src/library/filescanner_playlist.c +++ b/src/library/filescanner_playlist.c @@ -414,7 +414,6 @@ scan_playlist(const char *file, time_t mtime, int dir_id) { FILE *fp; struct media_file_info mfi; - struct stat sb; char buf[PATH_MAX]; char *path; size_t len; @@ -433,13 +432,6 @@ scan_playlist(const char *file, time_t mtime, int dir_id) if (pl_id < 0) return; // Not necessarily an error, could also be that the playlist hasn't changed - ret = stat(file, &sb); - if (ret < 0) - { - DPRINTF(E_LOG, L_SCAN, "Could not stat() '%s': %s\n", file, strerror(errno)); - return; - } - fp = fopen(file, "r"); if (!fp) {