update: check return values

Nearly all mapper functions can fail and will then return NULL.  Add
checks to all callers.
This commit is contained in:
Max Kellermann
2008-10-31 16:47:21 +01:00
parent d8e877e335
commit a5f8d4386c
4 changed files with 28 additions and 16 deletions

View File

@@ -206,9 +206,13 @@ static int
stat_directory_child(const struct directory *parent, const char *name,
struct stat *st)
{
char path_fs[MPD_PATH_MAX];
char buffer[MPD_PATH_MAX];
const char *path_fs;
path_fs = map_directory_child_fs(parent, name, buffer);
if (path_fs == NULL)
return -1;
map_directory_child_fs(parent, name, path_fs);
return stat(path_fs, st);
}