diff options
author | Mohammed Rafi KC <rkavunga@redhat.com> | 2017-11-02 17:20:29 +0530 |
---|---|---|
committer | Jeff Darcy <jeff@pl.atyp.us> | 2017-11-08 02:10:54 +0000 |
commit | 6c8e6d0e97342dd2881d7a3f3d03aaaad44502f2 (patch) | |
tree | 7a0626196285fa3a9e841ca224f6248faac29587 | |
parent | 0e01963615a5ef510bbb806280f7590c16a2af4c (diff) |
gfapi: Fix several coverity issues in glfs-fops.c
This patch fixes coverity issues 176
[1] : https://download.gluster.org/pub/gluster/glusterfs/static-analysis/
master/glusterfs-coverity/2017-10-30-9aa574a5/html/
Change-Id: I473323db27218ac784b8eae773a1efe911fcfec0
BUG: 789278
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
-rw-r--r-- | api/src/glfs-fops.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c index 72fd6975217..78ff335d0a5 100644 --- a/api/src/glfs-fops.c +++ b/api/src/glfs-fops.c @@ -1246,6 +1246,7 @@ pub_glfs_pwritev_async (struct glfs_fd *glfd, const struct iovec *iovec, frame = syncop_create_frame (THIS); if (!frame) { errno = ENOMEM; + ret = -1; goto out; } @@ -1263,9 +1264,10 @@ out: if (glfd) GF_REF_PUT (glfd); GF_FREE (gio); - if (frame) - STACK_DESTROY (frame->root); - + /* + * If there is any error condition check after the frame + * creation, we have to destroy the frame root. + */ glfs_subvol_done (glfd->fs, subvol); } |