diff options
| author | JasonJiaJie <[email protected]> | 2017-11-08 09:38:18 +0800 |
|---|---|---|
| committer | JasonJiaJie <[email protected]> | 2017-11-08 09:38:18 +0800 |
| commit | 20dbd2dd0aefa5b69c848c78de87e7fa6470b242 (patch) | |
| tree | c5bfb2da17154ca8d4e5e6fc1a00fd8e37910416 | |
| parent | f82191db8b9115379da05be91f7ac14e1d8bd4af (diff) | |
[Driver][Pipe]Memory leak issue when close a pipe.
There is a memory leak issue when close a pipe.
| -rw-r--r-- | components/drivers/src/pipe.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/components/drivers/src/pipe.c b/components/drivers/src/pipe.c index 0553c500ee..83f47cc27a 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 <rthw.h> #include <rtdevice.h> @@ -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 --; |
