From 4eb899a6de14660e2ce722dcc069836e17a6bc3e Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 2 Jan 2007 09:20:49 +0100 Subject: [PATCH] [PATCH] Fix double free in error path Reported by zhuxudong If we fail reading, we will free the realloc'ed pointer and jump to the error path which will free the original pointer. Fix this by clearing the original pointer. Signed-off-by: Jens Axboe --- blkparse.c | 1 + 1 file changed, 1 insertion(+) diff --git a/blkparse.c b/blkparse.c index 6bb5308..90614d8 100644 --- a/blkparse.c +++ b/blkparse.c @@ -2167,6 +2167,7 @@ static int ms_prime(struct ms_stream *msp) 1, &pci->fdblock); if (ret) { free(ptr); + bit = NULL; goto err; } -- 2.25.1