From a8446559e7d543a72dbb7a8ef314eba07dd0217d Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Mon, 14 Dec 2009 08:30:08 -0800 Subject: [PATCH] HAMMER Utility - fix unfreeable pointer in 'hammer info' * Fix the construction of the mountedon variable to ensure the variable can be free()'d. Reported-by: "Steve O'Hara-Smith" Also-suggested-by: Antonio Huete Jimenez --- sbin/hammer/cmd_info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/hammer/cmd_info.c b/sbin/hammer/cmd_info.c index bc93cb422f..d4f14c6609 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); -- 2.41.0