Commit 18e99ab6a32445853f0b42b64db4b6489b60259d

Stefan Sperling 2018-03-17T03:32:28

fix fd leak in got_object_open()

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/object.c b/lib/object.c
index 40fa201..1a04ad4 100644
--- a/lib/object.c
+++ b/lib/object.c
@@ -263,7 +263,7 @@ got_object_open(struct got_object **obj, struct got_repository *repo,
 	}
 done:
 	free(path);
-	if (err && f)
+	if (f)
 		fclose(f);
 	return err;