summaryrefslogtreecommitdiffstats
path: root/disk-utils/blockdev.c
diff options
context:
space:
mode:
authorlizf2007-10-22 05:26:27 +0200
committerKarel Zak2007-10-26 01:02:45 +0200
commit122db55d605b66a4c6b74a86c9cb74dd9007c866 (patch)
tree198fa4e1ec589c33fc3c22761752f3c38600c489 /disk-utils/blockdev.c
parentsfdisk: opened files leaving unclosed (diff)
downloadkernel-qcow2-util-linux-122db55d605b66a4c6b74a86c9cb74dd9007c866.tar.gz
kernel-qcow2-util-linux-122db55d605b66a4c6b74a86c9cb74dd9007c866.tar.xz
kernel-qcow2-util-linux-122db55d605b66a4c6b74a86c9cb74dd9007c866.zip
blockdev: fix: opened file leaving unclosed
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Diffstat (limited to 'disk-utils/blockdev.c')
-rw-r--r--disk-utils/blockdev.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/disk-utils/blockdev.c b/disk-utils/blockdev.c
index d02ebbce0..474d0dbfe 100644
--- a/disk-utils/blockdev.c
+++ b/disk-utils/blockdev.c
@@ -394,6 +394,8 @@ report_all_devices(void) {
sprintf(device, "/dev/%s", ptname);
report_device(device, 1);
}
+
+ fclose(procpt);
}
void
@@ -427,6 +429,8 @@ report_device(char *device, int quiet) {
fprintf(stderr, _("%s: ioctl error on %s\n"),
progname, device);
}
+
+ close(fd);
}
void