From ef219c20c272844011a21858658de93f63e70966 Mon Sep 17 00:00:00 2001 From: JasonJiaJie Date: Wed, 8 Nov 2017 09:38:18 +0800 Subject: [PATCH] [Driver][Pipe]Memory leak issue when close a pipe. There is a memory leak issue when close a pipe. --- components/drivers/src/pipe.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/drivers/src/pipe.c b/components/drivers/src/pipe.c index 0553c500e..83f47cc27 100644 --- a/components/drivers/src/pipe.c +++ b/components/drivers/src/pipe.c @@ -20,6 +20,7 @@ * Change Logs: * Date Author Notes * 2012-09-30 Bernard first version. + * 2017-11-08 JasonJiaJie fix memory leak issue when close a pipe. */ #include #include @@ -102,7 +103,7 @@ static int pipe_fops_close(struct dfs_fd *fd) if (device->ref_count == 1) { - rt_free(pipe->fifo); + rt_ringbuffer_destroy(pipe->fifo); pipe->fifo = RT_NULL; } device->ref_count --;