[library] Remove needless stat() in scan_playlist()

Fixes time-of-check time-of-use warning from CodeQL
This commit is contained in:
ejurgensen 2021-09-02 00:12:18 +02:00
parent 54faa11ce5
commit de7ab1547f

View File

@ -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)
{