mapper: fix potential crash in file permission check

This commit is contained in:
Max Kellermann 2012-08-15 22:19:03 +02:00
parent 93f9c2ab6b
commit 2276e7677b
2 changed files with 4 additions and 3 deletions

1
NEWS
View File

@ -10,6 +10,7 @@ ver 0.17.2 (2012/??/??)
- httpd: use monotonic clock, avoid hiccups after system clock adjustment
- httpd: fix throttling bug after resuming playback
* mapper: fix non-UTF8 music directory name
* mapper: fix potential crash in file permission check
ver 0.17.1 (2012/07/31)

View File

@ -93,10 +93,10 @@ check_directory(const char *path)
#endif
DIR *dir = opendir(path);
if (dir == NULL && errno == EACCES)
g_warning("No permission to read directory: %s", path);
else
if (dir != NULL)
closedir(dir);
else if (errno == EACCES)
g_warning("No permission to read directory: %s", path);
}
static void