From 5a8ad265c99e7872d48c16449d523bc3b2749464 Mon Sep 17 00:00:00 2001 From: Xin LI Date: Fri, 29 Dec 2017 06:22:05 +0000 Subject: [PATCH] The fix in r327273 turns a memory leak into freeing wild pointer. Fix this by freeing only the initialized pointer. --- sbin/fsdb/fsdb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sbin/fsdb/fsdb.c b/sbin/fsdb/fsdb.c index e815c32b9413..afb27c2bccce 100644 --- a/sbin/fsdb/fsdb.c +++ b/sbin/fsdb/fsdb.c @@ -565,8 +565,10 @@ CMDFUNCSTART(findblk) end: curinum = ocurrent; curinode = ginode(curinum); - free(wantedblk32); - free(wantedblk64); + if (is_ufs2) + free(wantedblk64); + else + free(wantedblk32); return 0; }