aboutsummaryrefslogtreecommitdiffstats
path: root/src/update.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-31 16:47:21 +0100
committerMax Kellermann <max@duempel.org>2008-10-31 16:47:21 +0100
commita5f8d4386c3d7b59bab15499d5d70f8d2713626f (patch)
tree148790958d648b34564a6c4216f3db42614c7d9d /src/update.c
parentd8e877e3355d0858c78a6d9a7060a6683024dd30 (diff)
downloadmpd-a5f8d4386c3d7b59bab15499d5d70f8d2713626f.tar.gz
mpd-a5f8d4386c3d7b59bab15499d5d70f8d2713626f.tar.xz
mpd-a5f8d4386c3d7b59bab15499d5d70f8d2713626f.zip
update: check return values
Nearly all mapper functions can fail and will then return NULL. Add checks to all callers.
Diffstat (limited to '')
-rw-r--r--src/update.c8
1 files changed, 6 insertions, 2 deletions
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);
}