[sheepdog] [PATCH v2 2/2] sheep: fix memory leak in local_req_async_main()

Robin Dong robin.k.dong at gmail.com
Thu Feb 13 11:16:59 CET 2014


From: Robin Dong <sanbai at taobao.com>

We find out a memory-leak point in local_req_async_main() by valgrind.
After fix it, the RSS of sheep daemon could keep stablely for press-testing.

Signed-off-by: Robin DOng <sanbai at taobao.com>
---
 sheep/request.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sheep/request.c b/sheep/request.c
index fbaf645..5867fa1 100644
--- a/sheep/request.c
+++ b/sheep/request.c
@@ -626,6 +626,7 @@ static void local_req_async_main(struct work *work)
 		areq->iocb->result = areq->result;
 
 	eventfd_xwrite(areq->iocb->efd, 1);
+	free(areq);
 }
 
 worker_fn int exec_local_req_async(struct sd_req *rq, void *data,
-- 
1.7.12.4




More information about the sheepdog mailing list