提交 34081463 编写于 作者: N Nicolas Pitre 提交者: Junio C Hamano

make verify_one_pack() a bit less wrong wrt packed_git structure

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: NNicolas Pitre <nico@cam.org>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 3449f8c4
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册