Commit 6cd97fccb30387c245f12ff4dad87354174aaa9e

Stefan Sperling 2018-04-22T16:34:33

plug fd leak in read_object_header_privsep()

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/lib/object.c b/lib/object.c
index 425c26d..a8913e5 100644
--- a/lib/object.c
+++ b/lib/object.c
@@ -252,6 +252,7 @@ read_object_header_privsep(struct got_object **obj, int fd)
 		f = fdopen(fd, "rb");
 		if (f == NULL) {
 			err = got_error_from_errno();
+			close(fd);
 			goto done;
 		}