From 60cff8ab4f5fa2ee7bea028937ba23674e1ee0cc Mon Sep 17 00:00:00 2001 From: Poornima G Date: Mon, 23 Feb 2015 16:10:33 +0530 Subject: 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 Reviewed-on: http://review.gluster.org/9725 Reviewed-by: Krishnan Parthasarathi Reviewed-by: Prashanth Pai Reviewed-by: Shyamsundar Ranganathan Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- libglusterfs/src/event-epoll.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libglusterfs') 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]; -- cgit