X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/f685054e7e37c2d24dd0f0391c6d5a4e1a0b9099..ce3c2407d9ac8cc5b45bda5f5991ac0fa89d1d98:/methods/ftp.cc 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