diff options
author | Zhou Zhengping <johnzzpcrystal@gmail.com> | 2016-07-22 04:09:15 +0800 |
---|---|---|
committer | Jeff Darcy <jdarcy@redhat.com> | 2016-07-22 08:12:31 -0700 |
commit | b76ac27f6fe2a183c350f236e3da16f38189e4a8 (patch) | |
tree | abf9dc5c61db79a32b58ee804ccb854fd800707f | |
parent | 99e1686638c26d1a3bb7d66c8a7fd3d93d07e75d (diff) |
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 <johnzzpcrystal@gmail.com>
Reviewed-on: http://review.gluster.org/14976
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
-rw-r--r-- | libglusterfs/src/iobuf.c | 2 |
1 files changed, 2 insertions, 0 deletions
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 |