From f58086c23f18af5657fd4af1753efcc66adc9d90 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 14 Dec 2014 13:53:51 +0100 Subject: [PATCH] emulator: Fix leaking file descriptor --- emulator/phy.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/emulator/phy.c b/emulator/phy.c index 9965ccaa8..685234713 100644 --- a/emulator/phy.c +++ b/emulator/phy.c @@ -68,6 +68,9 @@ static bool get_random_bytes(void *buf, size_t num_bytes) return false; len = read(fd, buf, num_bytes); + + close(fd); + if (len < 0) return false; -- 2.47.3