Commit Diff


commit - 0c41134356d52f1dd4db38637202364533f43866
commit + 6f748833062c683ec23808460f4bb67bd18693e3
blob - 5bee3eeb0b3d98dbaddb96e055a137ca1e27012c
blob + c16937331653c5414c3a3ed0215a2b9f3193f106
--- lib/repository.c
+++ lib/repository.c
@@ -266,7 +266,8 @@ got_repo_pack_fds_open(int **pack_fds)
 	/*
 	 * got_repo_pack_fds_close will try to close all of the
 	 * GOT_PACK_NUM_TEMPFILES fds, even the ones that didn't manage to get
-	 * a value from got_opentempfd(), resulting in a close(0).
+	 * a value from got_opentempfd(), which would result in a close(0) if
+	 * we do not initialize to -1 here.
 	 */
 	for (i = 0; i < GOT_PACK_NUM_TEMPFILES; i++)
 		pack_fds_tmp[i] = -1;