Commit Diff


commit - e17984a09be8df91edac0a44b56c088560951d24
commit + bb1c2cf3c90225c5f234ac42f3507b6e1839da5d
blob - 98f3281d5becb5173121e9f4f0b74eee3b61bebf
blob + 0f819a2049a5580f75d1892ec62d74882351a417
--- got/got.c
+++ got/got.c
@@ -909,6 +909,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",
@@ -1825,6 +1826,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)
@@ -2651,6 +2653,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);
@@ -3093,6 +3096,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);
@@ -3345,6 +3349,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;
 }
@@ -3530,6 +3535,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)
@@ -4540,6 +4546,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);
@@ -5149,6 +5156,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);
@@ -5504,6 +5512,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++) {
@@ -5816,6 +5825,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	return error;
 }
@@ -5976,6 +5986,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 
 	TAILQ_FOREACH(pe, &paths, entry)
@@ -6272,6 +6283,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	free(cwd);
 	free(repo_path);
@@ -6711,6 +6723,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	free(cwd);
 	free(repo_path);
@@ -7246,6 +7259,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	free(cwd);
 	free(repo_path);
@@ -7386,6 +7400,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);
@@ -7553,6 +7568,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);
@@ -7742,6 +7758,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	free(cwd);
 	return error;
@@ -8019,6 +8036,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	free(path);
 	free(cwd);
@@ -8347,6 +8365,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	free(cwd);
 	free(id_str);
@@ -8901,6 +8920,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	if (ref)
 		got_ref_close(ref);
@@ -9028,6 +9048,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 
 	return error;
@@ -9142,6 +9163,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	return error;
 }
@@ -10104,6 +10126,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	return error;
 }
@@ -11491,6 +11514,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	return error;
 }
@@ -11644,6 +11668,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	free(cwd);
 	free(base_commit_id);
@@ -11926,6 +11951,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	return error;
 }
@@ -12086,6 +12112,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);
@@ -12210,6 +12237,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);
@@ -12572,6 +12600,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 
 	got_ref_list_free(&refs);
@@ -12766,6 +12795,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 - d2e712fec877f56e6a3e85c0e93d10cc4ce1a702
blob + f516ffc9ef67e92fd5523b7796888ac876576edb
--- gotadmin/gotadmin.c
+++ gotadmin/gotadmin.c
@@ -380,6 +380,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 
 	free(repo_path);
@@ -767,6 +768,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);
@@ -860,6 +862,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	free(id_str);
 	free(pack_hash);
@@ -1050,6 +1053,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	free(id_str);
 	free(pack_hash);
@@ -1276,6 +1280,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	free(repo_path);
 	return error;
blob - 48c3db4951d9e65f17f32a087f88342694e36c1f
blob + a529b65f8c23a9d8b11d583f909109a1b9ccec8c
--- tog/tog.c
+++ tog/tog.c
@@ -2943,6 +2943,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	tog_free_refs();
 	return error;
@@ -4068,6 +4069,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	tog_free_refs();
 	return error;
@@ -5056,6 +5058,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	tog_free_refs();
 	return error;
@@ -5939,6 +5942,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	tog_free_refs();
 	return error;
@@ -6672,6 +6676,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	tog_free_refs();
 	return error;
@@ -6832,6 +6837,7 @@ done:
 		    got_repo_pack_fds_close(pack_fds);
 		if (error == NULL)
 			error = pack_err;
+		pack_fds = NULL;
 	}
 	free(id);
 	free(commit_id_str);