diff options
Diffstat (limited to 'methods/ftp.cc')
-rw-r--r-- | methods/ftp.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/methods/ftp.cc b/methods/ftp.cc index b1e8d2b0a..89c81f384 100644 --- a/methods/ftp.cc +++ b/methods/ftp.cc @@ -721,14 +721,14 @@ bool FTPConn::CreateDataFd() DataListenFd = -1; // Get the information for a listening socket. - struct addrinfo *BindAddr = 0; + struct addrinfo *BindAddr = NULL; struct addrinfo Hints; memset(&Hints,0,sizeof(Hints)); Hints.ai_socktype = SOCK_STREAM; Hints.ai_flags |= AI_PASSIVE; Hints.ai_family = ((struct sockaddr *)&ServerAddr)->sa_family; int Res; - if ((Res = getaddrinfo(0,"0",&Hints,&BindAddr)) != 0) + if ((Res = getaddrinfo(0,"0",&Hints,&BindAddr)) != 0 || BindAddr == NULL) return _error->Error(_("getaddrinfo was unable to get a listening socket")); // Construct the socket |