summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
Diffstat (limited to 'api')
-rw-r--r--api/src/glfs-fops.c12
-rw-r--r--api/src/glfs.c4
2 files changed, 10 insertions, 6 deletions
diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c
index 8d905193a..e1fa697f9 100644
--- a/api/src/glfs-fops.c
+++ b/api/src/glfs-fops.c
@@ -752,10 +752,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);
}
diff --git a/api/src/glfs.c b/api/src/glfs.c
index 29ed47c0c..1bae78d23 100644
--- a/api/src/glfs.c
+++ b/api/src/glfs.c
@@ -666,8 +666,8 @@ glfs_fini (struct glfs *fs)
glfs_subvol_done (fs, subvol);
- if (ctx->log.logfile)
- fclose (ctx->log.logfile);
+ if (gf_log_fini(ctx) != 0)
+ ret = -1;
return ret;
}