From: Shawn O. Pearce Date: Sat, 17 Apr 2010 20:07:37 +0000 (-0700) Subject: http.c: Drop useless != NULL test in finish_http_pack_request X-Git-Tag: v1.7.2-rc0~118^2~8 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3065274c58a4f4d0c6eef7e29a1484cf2c288131;p=git.git 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: Shawn O. Pearce Signed-off-by: Junio C Hamano --- diff --git a/http.c b/http.c index e9e226956..7942eea5d 100644 --- a/http.c +++ b/http.c @@ -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)