From eb597289cbb18856829dc35283b21ec0bc08444a Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Fri, 12 Jul 2019 18:40:24 -0700 Subject: [PATCH] Avoid null dereference Found via clang-tidy. --- src/s3fs.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/s3fs.cpp b/src/s3fs.cpp index 7fad8a6..dce9a03 100644 --- a/src/s3fs.cpp +++ b/src/s3fs.cpp @@ -893,8 +893,9 @@ static int s3fs_getattr(const char* _path, struct stat* stbuf) } stbuf->st_blksize = 4096; stbuf->st_blocks = get_blocks(stbuf->st_size); + + S3FS_PRN_DBG("[path=%s] uid=%u, gid=%u, mode=%04o", path, (unsigned int)(stbuf->st_uid), (unsigned int)(stbuf->st_gid), stbuf->st_mode); } - S3FS_PRN_DBG("[path=%s] uid=%u, gid=%u, mode=%04o", path, (unsigned int)(stbuf->st_uid), (unsigned int)(stbuf->st_gid), stbuf->st_mode); S3FS_MALLOCTRIM(0); return result;