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>
This commit is contained in:
Lalatendu Mohanty 2014-01-06 13:37:24 +05:30 committed by Vijay Bellur
parent 21ffbf9b92
commit f9162911e8

View File

@ -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);
}