From a5f8d4386c3d7b59bab15499d5d70f8d2713626f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 31 Oct 2008 16:47:21 +0100 Subject: update: check return values Nearly all mapper functions can fail and will then return NULL. Add checks to all callers. --- src/update.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/update.c') diff --git a/src/update.c b/src/update.c index 5ab75d7ac..38bc22a28 100644 --- a/src/update.c +++ b/src/update.c @@ -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); } -- cgit v1.2.3