summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
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 f3ac335fb..b09dd90f7 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);
}