[PATCH 1/3] lib/nilfs.c: fix potential leak at nilfs_open()

2015-01-18 Thread Ryusuke Konishi
nilfs_open() can exit without closing nilfs-n_devfd and freeing nilfs-n_dev and nilfs-n_sb if it first initializes a nilfs object in the code path for NILFS_OPEN_RAW mode and then escapes through out_nilfs label. This fixes the leak issue. Signed-off-by: Ryusuke Konishi

[PATCH 2/3] nilfs-utils: get rid of my_free()

2015-01-18 Thread Ryusuke Konishi
Remove my_free wrapper functions used in fstab.c, mount.nilfs2.c and umount.nilfs2.c. They are just doing an unnecessary null check before calling free() and eliminable since free(NULL) is just ignored. Signed-off-by: Ryusuke Konishi konishi.ryus...@lab.ntt.co.jp --- sbin/mount/fstab.c

[PATCH v2 2/3] nilfs-utils: get rid of my_free()

2015-01-18 Thread Ryusuke Konishi
Remove my_free wrapper functions used in fstab.c, mount.nilfs2.c and umount.nilfs2.c. They are just doing an unnecessary null check before calling free() and eliminable since free(NULL) is just ignored. Signed-off-by: Ryusuke Konishi konishi.ryus...@lab.ntt.co.jp --- sbin/mount/fstab.c

[PATCH v2 3/3] nilfs-utils: get rid of null checks before calling free()

2015-01-18 Thread Ryusuke Konishi
Remove unnecessary null checks before calling free() function. Signed-off-by: Ryusuke Konishi konishi.ryus...@lab.ntt.co.jp --- lib/cleaner_ctl.c | 6 ++ lib/gc.c | 3 +-- lib/nilfs.c | 19 +++ lib/realpath.c| 9 +++-- 4 files changed, 13