summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/event-epoll.c
diff options
context:
space:
mode:
authorPoornima G <pgurusid@redhat.com>2015-02-23 16:10:33 +0530
committerVijay Bellur <vbellur@redhat.com>2015-03-02 00:56:07 -0800
commit60cff8ab4f5fa2ee7bea028937ba23674e1ee0cc (patch)
tree177930f503c785db6113fa77df0892ab647dfd0b /libglusterfs/src/event-epoll.c
parent4f143bfe4eabc34c5682a3b0421092e5e22ee507 (diff)
epoll: Fix a leak in slot allocation.
When the slots_used in a table becomes 0, the table will not get reused, leading to a leak. This patch fixes the leak. Change-Id: Ib86826d287368174ea7ebe0d0d64b2dec574634e BUG: 1093594 Signed-off-by: Poornima G <pgurusid@redhat.com> Reviewed-on: http://review.gluster.org/9725 Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-by: Prashanth Pai <ppai@redhat.com> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'libglusterfs/src/event-epoll.c')
-rw-r--r--libglusterfs/src/event-epoll.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libglusterfs/src/event-epoll.c b/libglusterfs/src/event-epoll.c
index 62085dbef10..ff191129da0 100644
--- a/libglusterfs/src/event-epoll.c
+++ b/libglusterfs/src/event-epoll.c
@@ -88,7 +88,9 @@ __event_slot_alloc (struct event_pool *event_pool, int fd)
table = __event_newtable (event_pool, i);
if (!table)
return -1;
- }
+ } else {
+ table = event_pool->ereg[i];
+ }
break;
default:
table = event_pool->ereg[i];