Fix fifo leak
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/blktrace.c b/blktrace.c
index fc98091..698d16f 100644
--- a/blktrace.c
+++ b/blktrace.c
@@ -227,6 +227,7 @@
cpu = t.cpu;
} while (1);
+ fifo_free(fifo);
close(fd);
if (!ios[DDIR_READ] && !ios[DDIR_WRITE]) {
@@ -253,5 +254,6 @@
return 0;
err:
close(fd);
+ fifo_free(fifo);
return 1;
}
diff --git a/fifo.h b/fifo.h
index 6a9115d..cfacea9 100644
--- a/fifo.h
+++ b/fifo.h
@@ -28,6 +28,7 @@
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)
{