diff options
author | Xin LI <delphij@FreeBSD.org> | 2017-12-29 06:22:05 +0000 |
---|---|---|
committer | Xin LI <delphij@FreeBSD.org> | 2017-12-29 06:22:05 +0000 |
commit | 5a8ad265c99e7872d48c16449d523bc3b2749464 (patch) | |
tree | 9df041d6446d7a76aba19303ae3b046217ba2dde /sbin/fsdb | |
parent | b6d439667a2e2417024e24e05fca653e66455b53 (diff) | |
download | src-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.c | 6 |
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; } |