Skip to content

Commit 5d9cfa2

Browse files
stefanbellergitster
authored andcommitted
daemon.c:handle: Remove unneeded check for null pointer.
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 <[email protected]> Reviewed-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f59bebb commit 5d9cfa2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

daemon.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ static void handle(int incoming, struct sockaddr *addr, socklen_t addrlen)
760760
snprintf(portbuf, sizeof(portbuf), "REMOTE_PORT=%d",
761761
ntohs(sin_addr->sin_port));
762762
#ifndef NO_IPV6
763-
} else if (addr && addr->sa_family == AF_INET6) {
763+
} else if (addr->sa_family == AF_INET6) {
764764
struct sockaddr_in6 *sin6_addr = (void *) addr;
765765

766766
char *buf = addrbuf + 12;

0 commit comments

Comments
 (0)