Commit Diff


commit - 0b1c1d9c3d925795955ba06a2ea73228e1c1d112
commit + 7c60996cbac298efd8023b1b599d13371ae61963
blob - b568413a0b3be4523b319571a011282654db4476
blob + 31656dd0f5f80306da9be9a214fd7681951dbd09
--- lib/repository.c
+++ lib/repository.c
@@ -261,7 +261,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;