diff options
author | Poornima <pgurusid@redhat.com> | 2013-10-11 04:06:56 +0000 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2013-10-11 12:05:55 -0700 |
commit | d3558ae5c4b1cf6909e27e8fabd6ec44fe6aa971 (patch) | |
tree | 837fc12926b9756fe223faa6a496effddddc6f81 /api | |
parent | 86f936f4381a8d8490255ef439ec3c44ca79fe76 (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/6074
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'api')
-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 e411f5a8304..8119cc4f693 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); |