From 753146c0ff4b1b55892b71b36d6ca97797867aaa Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Tue, 27 Jul 2010 11:13:32 +0000 Subject: some check added to the variables after GF_CALLOC handles some NULL dereference problems (reported by clang when ran with code where '#define GF_CALLOC NULL'). Signed-off-by: Amar Tumballi Signed-off-by: Anand V. Avati BUG: 966 (NULL check for avoiding NULL dereferencing of pointers..) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=966 --- xlators/storage/posix/src/posix.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'xlators/storage/posix/src/posix.c') diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index 2810bbd6a..da5156709 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -179,6 +179,8 @@ _posix_xattr_get_set (dict_t *xattr_req, if (xattr_size > 0) { value = GF_CALLOC (1, xattr_size + 1, gf_posix_mt_char); + if (!value) + return; sys_lgetxattr (filler->real_path, key, value, xattr_size); -- cgit