diff options
| author | Lalatendu Mohanty <lmohanty@redhat.com> | 2014-01-06 13:37:24 +0530 | 
|---|---|---|
| committer | Vijay Bellur <vbellur@redhat.com> | 2014-01-14 00:20:43 -0800 | 
| commit | c7ae0a71aac95d32f3f3c9ffe9b2313677ca9829 (patch) | |
| tree | 9823b72abc716f6c94cce2fea5318cd4e1d9ea61 /api/src/glfs-fops.c | |
| parent | a99e4e4bf576e5120dca4f2a47fb1466a8005204 (diff) | |
libgfapi : Fixing some NULL pointer dereferencing issues.
1. Fixing dereferencing null pointer "gio"
2. Checking "frame" before calling STACK_DESTROY (frame->root)
Backport of patch : http://review.gluster.org/#/c/6313/
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>
Signed-off-by: Lalatendu Mohanty <lmohanty@redhat.com>
Reviewed-on: http://review.gluster.org/6688
Diffstat (limited to 'api/src/glfs-fops.c')
| -rw-r--r-- | api/src/glfs-fops.c | 12 | 
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);  	}  | 
