Skip to content

Commit

Permalink
make verify_one_pack() a bit less wrong wrt packed_git structure
Browse files Browse the repository at this point in the history
Simply freeing it is wrong.  There are many things attached to this
structure that are not cleaned up.  In practice this doesn't matter much
since this happens just before the program exits, but it is still
a bit more "correct" to leak it implicitly rather than explicitly.

And therefore it is also a good idea to register it with
install_packed_git().  Not only might it have better chance of being
properly cleaned up if such functionality is implemented for the general
case, but some functions like init_revindex() expect all packed_git
instances to be globally accessible.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Nicolas Pitre authored and Junio C Hamano committed Mar 1, 2008
1 parent 3449f8c commit 3408146
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion builtin-verify-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ static int verify_one_pack(const char *path, int verbose)
if (!pack)
return error("packfile %s not found.", arg);

install_packed_git(pack);
err = verify_pack(pack, verbose);
free(pack);

return err;
}
Expand Down

0 comments on commit 3408146

Please sign in to comment.