xfsprogs: fix potential memory leak in repare/sb.c
PATCH 1/1 xfsprogs: fix potential memory leak in repare/sb.c
Following Resource leak is reported by coverity:
CID 997011 (#1 of 1): Resource leak (RESOURCE_LEAK)6. leaked_storage:
Variable "buf" going out of scope leaks the storage it points to.
505 return(XR_EOF);
Add a free(buf) to solve it.
--- repair/sb.c | 1 + 1 file changed, 1 insertion(+)
repair/sb.c +1 -0
@@ -502,6 +502,7 @@ get_sb(xfs_sb_t *sbp, xfs_off_t off, int size, xfs_agnumber_t agno)do_warn (_ ("error reading superblock %u -- seek to offset %" PRId64" failed\n" ), agno, off); +free (buf);return (XR_EOF ); }
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 10 lines · Li Zhong
Following Resource leak is reported by coverity:
CID 997011 (#1 of 1): Resource leak (RESOURCE_LEAK)6.
leaked_storage:
Variable "buf" going out of scope leaks the storage it points to.
505return(XR_EOF);Add a free(buf) to solve it.
Signed-off-by Li Zhong<[email protected]>---
Looks good.
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
This has been committed.
Thanks
--Rich
commit 70ee4153f4c998774adcee1e576d3c1f305b92d0
Author: Li Zhong <[email protected]> Date: Wed Sep 18 09:40:42 2013 +0000
xfsprogs: fix potential memory leak in repare/sb.c
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs