aboutsummaryrefslogtreecommitdiff
path: root/sbin/fsdb
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2017-12-29 06:22:05 +0000
committerXin LI <delphij@FreeBSD.org>2017-12-29 06:22:05 +0000
commit5a8ad265c99e7872d48c16449d523bc3b2749464 (patch)
tree9df041d6446d7a76aba19303ae3b046217ba2dde /sbin/fsdb
parentb6d439667a2e2417024e24e05fca653e66455b53 (diff)
downloadsrc-5a8ad265c99e7872d48c16449d523bc3b2749464.tar.gz
src-5a8ad265c99e7872d48c16449d523bc3b2749464.zip
The fix in r327273 turns a memory leak into freeing wild pointer.
Fix this by freeing only the initialized pointer.
Notes
Notes: svn path=/head/; revision=327335
Diffstat (limited to 'sbin/fsdb')
-rw-r--r--sbin/fsdb/fsdb.c6
1 files 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;
}