daemon.c:handle: Remove unneeded check for null pointer.
authorStefan Beller <stefanbeller@googlemail.com>
Sun, 14 Jul 2013 21:35:46 +0000 (23:35 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 15 Jul 2013 16:45:11 +0000 (09:45 -0700)
addr doesn't need to be checked at that line as it it already accessed
7 lines before in the if (addr->sa_family).

Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
daemon.c

index df8c0ab..80df5cb 100644 (file)
--- a/daemon.c
+++ b/daemon.c
@@ -760,7 +760,7 @@ static void handle(int incoming, struct sockaddr *addr, socklen_t addrlen)
                snprintf(portbuf, sizeof(portbuf), "REMOTE_PORT=%d",
                    ntohs(sin_addr->sin_port));
 #ifndef NO_IPV6
                snprintf(portbuf, sizeof(portbuf), "REMOTE_PORT=%d",
                    ntohs(sin_addr->sin_port));
 #ifndef NO_IPV6
-       } else if (addr && addr->sa_family == AF_INET6) {
+       } else if (addr->sa_family == AF_INET6) {
                struct sockaddr_in6 *sin6_addr = (void *) addr;
 
                char *buf = addrbuf + 12;
                struct sockaddr_in6 *sin6_addr = (void *) addr;
 
                char *buf = addrbuf + 12;