提交 3065274c 编写于 作者: S Shawn O. Pearce 提交者: Junio C Hamano

http.c: Drop useless != NULL test in finish_http_pack_request

The test preq->packfile != NULL is always true.  If packfile was
actually NULL when entering this function the ftell() above would
crash out with a SIGSEGV, resulting in never reaching this point.

Simplify the code by just removing the conditional.
Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 021ab6f0
......@@ -1005,12 +1005,9 @@ int finish_http_pack_request(struct http_pack_request *preq)
struct packed_git *p = preq->target;
p->pack_size = ftell(preq->packfile);
if (preq->packfile != NULL) {
fclose(preq->packfile);
preq->packfile = NULL;
preq->slot->local = NULL;
}
fclose(preq->packfile);
preq->packfile = NULL;
preq->slot->local = NULL;
lst = preq->lst;
while (*lst != p)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册