diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2010-04-17 13:07:37 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-04-17 13:55:46 -0700 |
commit | 3065274c58a4f4d0c6eef7e29a1484cf2c288131 (patch) | |
tree | 35ca8d64acbe983a7e080ab09d105f8cb41334f7 /http.c | |
parent | 021ab6f00b66d0d3931310e77383239a606c96c2 (diff) | |
download | git-3065274c58a4f4d0c6eef7e29a1484cf2c288131.tar.gz |
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 <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'http.c')
-rw-r--r-- | http.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -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) |