DragonFly BSD
DragonFly bugs List (threaded) for 2009-12
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: [issue1625] coer dump from hammer info


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 14 Dec 2009 08:07:01 -0800 (PST)

:	So in short I'm pretty sure mountedon should not be being freed,
:commenting out the free on line 185 does make hammer info work for me.
:
:-- 
:Steve O'Hara-Smith                          |   Directable Mirror Arrays

    Nice catch.  It looks like the best solution is to strdup() the
    passed path on line 167.  Could you keep the free() and try that
    instead?

					-Matt
					Matthew Dillon 
					<dillon@backplane.com>

diff --git a/sbin/hammer/cmd_info.c b/sbin/hammer/cmd_info.c
index bc93cb4..d4f14c6 100644
--- a/sbin/hammer/cmd_info.c
+++ b/sbin/hammer/cmd_info.c
@@ -164,7 +164,7 @@ show_info(char *path)
 		if (ioctl(fd, HAMMERIOC_GET_PSEUDOFS, &pfs) >= 0) {
 			ismaster = (pfs_od.mirror_flags & HAMMER_PFSD_SLAVE) ? 0 : 1;
 			if (pfs_id == 0)
-				mountedon = path;
+				mountedon = strdup(path);
 			else
 				mountedon = find_pfs_mount(pfs_id, info.vol_fsid, ismaster);
 



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]