diff options
Diffstat (limited to 'source3')
-rw-r--r-- | source3/lib/util.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c index 2457dec14d..f5cae86430 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -3541,6 +3541,10 @@ char *client_name(void) strcpy(name_buf,"UNKNOWN"); + if (Client == -1) { + return name_buf; + } + if (getpeername(Client, &sa, &length) < 0) { DEBUG(0,("getpeername failed\n")); return name_buf; @@ -3579,6 +3583,10 @@ char *client_addr(void) strcpy(addr_buf,"0.0.0.0"); + if (Client == -1) { + return addr_buf; + } + if (getpeername(Client, &sa, &length) < 0) { DEBUG(0,("getpeername failed\n")); return addr_buf; |