diff options
author | Poornima <pgurusid@redhat.com> | 2013-10-11 04:06:56 +0000 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2013-11-26 10:39:39 -0800 |
commit | fdf3d652acbbe6aa145b7dccd193392b9d1581bd (patch) | |
tree | 33c0855c39bbd5fef66e479701e6b9dd270f3e60 | |
parent | a15edf06b1cf481b459bfc4ee346624b688f6b7d (diff) |
gfapi: Fix iobuf leaks in gfapi
In glfs_readv, if syncop_readv() fails with return value <= 0
the iobref was not being unrefd which would cause iobuf leaks.
Change-Id: I9850ae149e53cf75ba26f8b5f4c5446cce4b5991
BUG: 1018176
Signed-off-by: Poornima <pgurusid@redhat.com>
Reviewed-on: http://review.gluster.org/6324
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
-rw-r--r-- | api/src/glfs-fops.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c index e5143b346e6..f58de45a8ae 100644 --- a/api/src/glfs-fops.c +++ b/api/src/glfs-fops.c @@ -495,13 +495,13 @@ glfs_preadv (struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt, glfd->offset = (offset + size); - if (iov) - GF_FREE (iov); - if (iobref) - iobref_unref (iobref); - ret = size; out: + if (iov) + GF_FREE (iov); + if (iobref) + iobref_unref (iobref); + if (fd) fd_unref (fd); |