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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user