From a3079e82ddda90055d7247f000a8e9afa7f8a5c5 Mon Sep 17 00:00:00 2001 From: iphydf Date: Wed, 10 Jan 2018 13:22:07 +0000 Subject: [PATCH] Fix file descriptor leak in hstox test. We return E_WRITE because closing only fails when an I/O error occurs, which is likely an error from the write() call above. See close(2) for details. http://man7.org/linux/man-pages/man2/close.2.html --- testing/hstox/driver.c | 1 + 1 file changed, 1 insertion(+) diff --git a/testing/hstox/driver.c b/testing/hstox/driver.c index add43901..442967bf 100644 --- a/testing/hstox/driver.c +++ b/testing/hstox/driver.c @@ -89,6 +89,7 @@ static int write_sample_input(msgpack_object req) msgpack_pack_object(&pk, req); check_return(E_WRITE, write(fd, sbuf.data, sbuf.size)); + check_return(E_WRITE, close(fd)); return E_OK; }