From b76ac27f6fe2a183c350f236e3da16f38189e4a8 Mon Sep 17 00:00:00 2001 From: Zhou Zhengping Date: Fri, 22 Jul 2016 04:09:15 +0800 Subject: core: coverity, NULL potinter check iobuf_get_page_aligned should check the return pointer after calling iobuf_get2. CID: 1357868 Change-Id: I3aa5b09bce2225aa70cf3c60a6b6f4e4eca1dee6 BUG: 1358936 Signed-off-by: Zhou Zhengping Reviewed-on: http://review.gluster.org/14976 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Jeff Darcy --- libglusterfs/src/iobuf.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libglusterfs') diff --git a/libglusterfs/src/iobuf.c b/libglusterfs/src/iobuf.c index 17cd68fc206..76584fc9cde 100644 --- a/libglusterfs/src/iobuf.c +++ b/libglusterfs/src/iobuf.c @@ -692,6 +692,8 @@ iobuf_get_page_aligned (struct iobuf_pool *iobuf_pool, size_t page_size, } iobuf = iobuf_get2 (iobuf_pool, req_size + align_size); + if (!iobuf) + return NULL; /* If std allocation was used, then free_ptr will be non-NULL. In this * case, we do not want to modify the original free_ptr. * On the other hand, if the buf was gotten through the available -- cgit