Commit Diff


commit - 1b4d350c1e8b01882ea60640e129b7f8b6586b3d
commit + df67eb78ca3c32640d852cacd2086d83713c97b2
blob - 60476351c5599bd9549cccf48000ca54c8e8964e
blob + 7ebc07e303a583c4047c06f59ccdcf013bddf3f8
--- got/got.c
+++ got/got.c
@@ -908,6 +908,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	if (preserve_logmsg) {
 		fprintf(stderr, "%s: log message preserved in %s\n",
@@ -1824,6 +1825,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	if (fetchpid > 0) {
 		if (kill(fetchpid, SIGTERM) == -1)
@@ -2650,6 +2652,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	TAILQ_FOREACH(pe, &refs, entry) {
 		free((void *)pe->path);
@@ -3092,6 +3095,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	if (head_ref)
 		got_ref_close(head_ref);
@@ -3344,6 +3348,7 @@ wrap_not_worktree_error(const struct got_error *orig_e
 		    got_repo_pack_fds_close(pack_fds);
 		if (err == NULL)
 			err = pack_err;
+		pack_fds = NULL;
 	}
 	return err;
 }
@@ -3529,6 +3534,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	free(worktree_path);
 	TAILQ_FOREACH(pe, &paths, entry)
@@ -4539,6 +4545,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	if (refs_idmap)
 		got_reflist_object_id_map_free(refs_idmap);
@@ -5148,6 +5155,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	TAILQ_FOREACH(pe, &paths, entry)
 		free((char *)pe->path);
@@ -5503,6 +5511,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	if (bca.lines) {
 		for (i = 0; i < bca.nlines; i++) {
@@ -5815,6 +5824,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	return error;
 }
@@ -5975,6 +5985,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 
 	TAILQ_FOREACH(pe, &paths, entry)
@@ -6271,6 +6282,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	free(cwd);
 	free(repo_path);
@@ -6710,6 +6722,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	free(cwd);
 	free(repo_path);
@@ -7245,6 +7258,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	free(cwd);
 	free(repo_path);
@@ -7385,6 +7399,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	TAILQ_FOREACH(pe, &paths, entry)
 		free((char *)pe->path);
@@ -7552,6 +7567,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	TAILQ_FOREACH(pe, &paths, entry)
 		free((char *)pe->path);
@@ -7741,6 +7757,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	free(cwd);
 	return error;
@@ -8018,6 +8035,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	free(path);
 	free(cwd);
@@ -8346,6 +8364,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	free(cwd);
 	free(id_str);
@@ -8900,6 +8919,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	if (ref)
 		got_ref_close(ref);
@@ -9027,6 +9047,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 
 	return error;
@@ -9141,6 +9162,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	return error;
 }
@@ -10103,6 +10125,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	return error;
 }
@@ -11490,6 +11513,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	return error;
 }
@@ -11643,6 +11667,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	free(cwd);
 	free(base_commit_id);
@@ -11925,6 +11950,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	return error;
 }
@@ -12085,6 +12111,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	TAILQ_FOREACH(pe, &paths, entry)
 		free((char *)pe->path);
@@ -12209,6 +12236,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	TAILQ_FOREACH(pe, &paths, entry)
 		free((char *)pe->path);
@@ -12571,6 +12599,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 
 	got_ref_list_free(&refs);
@@ -12765,6 +12794,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	TAILQ_FOREACH(pe, &paths, entry)
 		free((char *)pe->path);
blob - b88d54df494f629ad336256ee0db5595bf370946
blob + 6d8762d9be86470bcf1fcaecc8c45b6ce20bf04b
--- gotadmin/gotadmin.c
+++ gotadmin/gotadmin.c
@@ -379,6 +379,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 
 	free(repo_path);
@@ -766,6 +767,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	got_pathlist_free(&exclude_args);
 	got_ref_list_free(&exclude_refs);
@@ -859,6 +861,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	free(id_str);
 	free(pack_hash);
@@ -1049,6 +1052,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	free(id_str);
 	free(pack_hash);
@@ -1275,6 +1279,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	free(repo_path);
 	return error;
blob - 2718272468dfb56884b51d1ccde716d356340aaf
blob + 6e32519f91ea580135c286014f2fcb3a5a866331
--- tog/tog.c
+++ tog/tog.c
@@ -2952,6 +2952,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	tog_free_refs();
 	return error;
@@ -4077,6 +4078,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	tog_free_refs();
 	return error;
@@ -5065,6 +5067,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	tog_free_refs();
 	return error;
@@ -5948,6 +5951,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	tog_free_refs();
 	return error;
@@ -6681,6 +6685,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	tog_free_refs();
 	return error;
@@ -6841,6 +6846,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	free(id);
 	free(commit_id_str);