summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorLalatendu Mohanty <lmohanty@redhat.com>2014-01-06 13:37:24 +0530
committerVijay Bellur <vbellur@redhat.com>2014-01-09 22:45:05 -0800
commitf9162911e85f95fa2a10d4b70d3f09876bd15adb (patch)
treee16a35bf91afe48d972b38b4595d9937cfd3e596 /api
parent21ffbf9b92b2478c17f816a8d0418a7cb080998a (diff)
libgfapi : Fixing some NULL pointer dereferencing issues.
1. Fixing dereferencing null pointer "gio" 2. Checking "frame" before calling STACK_DESTROY (frame->root) Change-Id: If2ce8804a8e9f3f99f71a8c0d13900afb5635072 Signed-off-by: Lalatendu Mohanty <lmohanty@redhat.com> Reviewed-on: http://review.gluster.org/6313 Reviewed-by: Santosh Pradhan <spradhan@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com> Reviewed-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'api')
-rw-r--r--api/src/glfs-fops.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c
index f3ac335fb39..b09dd90f7b1 100644
--- a/api/src/glfs-fops.c
+++ b/api/src/glfs-fops.c
@@ -710,10 +710,14 @@ glfs_preadv_async (struct glfs_fd *glfd, const struct iovec *iovec, int count,
offset, flags, NULL);
out:
- if (ret) {
- GF_FREE (gio->iov);
- GF_FREE (gio);
- STACK_DESTROY (frame->root);
+ if (ret) {
+ if (gio) {
+ GF_FREE (gio->iov);
+ GF_FREE (gio);
+ }
+ if (frame) {
+ STACK_DESTROY (frame->root);
+ }
glfs_subvol_done (fs, subvol);
}