From 6c8e6d0e97342dd2881d7a3f3d03aaaad44502f2 Mon Sep 17 00:00:00 2001 From: Mohammed Rafi KC Date: Thu, 2 Nov 2017 17:20:29 +0530 Subject: 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 --- api/src/glfs-fops.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'api') 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); } -- cgit