From 38470f85fa4acddab4339db9c8805a19bc87578e Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Wed, 16 May 2007 09:26:23 +0200 Subject: [PATCH] Fix fifo leak Signed-off-by: Jens Axboe --- blktrace.c | 2 ++ fifo.h | 1 + 2 files changed, 3 insertions(+) diff --git a/blktrace.c b/blktrace.c index fc980918..698d16ff 100644 --- a/blktrace.c +++ b/blktrace.c @@ -227,6 +227,7 @@ int load_blktrace(struct thread_data *td, const char *filename) cpu = t.cpu; } while (1); + fifo_free(fifo); close(fd); if (!ios[DDIR_READ] && !ios[DDIR_WRITE]) { @@ -253,5 +254,6 @@ int load_blktrace(struct thread_data *td, const char *filename) return 0; err: close(fd); + fifo_free(fifo); return 1; } diff --git a/fifo.h b/fifo.h index 6a9115d4..cfacea99 100644 --- a/fifo.h +++ b/fifo.h @@ -28,6 +28,7 @@ struct fifo { struct fifo *fifo_alloc(unsigned int); unsigned int fifo_put(struct fifo *, void *, unsigned int); unsigned int fifo_get(struct fifo *, void *, unsigned int); +void fifo_free(struct fifo *); static inline unsigned int fifo_len(struct fifo *fifo) { -- 2.25.1