ftpState->data.port = port;
+ safe_free(ftpState->data.host);
ftpState->data.host = xstrdup(fd_table[ftpState->ctrl.conn->fd].ipaddr);
safe_free(ftpState->ctrl.last_command);
ftpState->data.port = port;
+ safe_free(ftpState->data.host);
if (Config.Ftp.sanitycheck)
ftpState->data.host = xstrdup(fd_table[ftpState->ctrl.conn->fd].ipaddr);
else
ftpState->data.clear();
else
ftpState->data.close();
- ftpState->data.host = NULL;
+ safe_free(ftpState->data.host);
/*
* Set up a listen socket on the same local address as the
/** On COMM_OK start using the accepted data socket and discard the temporary listen socket. */
data.close();
data.opened(io.conn, dataCloser());
- io.conn->remote.NtoA(data.host,SQUIDHOSTNAMELEN);
+ static char ntoapeer[MAX_IPSTRLEN];
+ io.conn->remote.NtoA(ntoapeer,sizeof(ntoapeer));
+ data.host = xstrdup(ntoapeer);
debugs(9, 3, HERE << "Connected data socket on " <<
io.conn << ". FD table says: " <<