[PATCH 4/10] Close stream in 'I' switch handling

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

 



The file containing the list of devices was never closed
after processing was complete.

Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
---

diff --git a/blktrace.c b/blktrace.c
index 848250d..5f74ef2 100644
--- a/blktrace.c
+++ b/blktrace.c
@@ -2076,9 +2076,13 @@ static int handle_args(int argc, char *argv[])
 				return 1;
 			}
 
-			while (fscanf(ifp, "%s\n", dev_line) == 1)
-				if (add_devpath(dev_line) != 0)
+			while (fscanf(ifp, "%s\n", dev_line) == 1) {
+				if (add_devpath(dev_line) != 0) {
+					fclose(ifp);
 					return 1;
+				}
+			}
+			fclose(ifp);
 			break;
 		}
 


--
To unsubscribe from this list: send the line "unsubscribe linux-btrace" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux