When recycling a cached connection, increment the reference count so that

the heap block does not get freed and reused. This should fix the
pkg_add -r crashes that have been happening for months.
This commit is contained in:
Tim J. Robbins 2002-10-20 10:36:27 +00:00
parent 5728b15141
commit 9d649c1fd0

View File

@ -866,7 +866,7 @@ _ftp_cached_connect(struct url *url, struct url *purl, const char *flags)
if (_ftp_isconnected(url)) {
e = _ftp_cmd(cached_connection, "NOOP");
if (e == FTP_OK || e == FTP_SYNTAX_ERROR)
return (cached_connection);
return (_fetch_ref(cached_connection));
}
/* connect to server */