summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 021ab6f)
raw | patch | inline | side by side (parent: 021ab6f)
author | Shawn O. Pearce <spearce@spearce.org> | |
Sat, 17 Apr 2010 20:07:37 +0000 (13:07 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 17 Apr 2010 20:55:46 +0000 (13:55 -0700) |
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>
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>
http.c | patch | blob | history |
index e9e22695665ec62381ea56b19f8c61ed898e503e..7942eea5d829bd172f141c056cf83bdfcf83546b 100644 (file)
--- a/http.c
+++ b/http.c
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)