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:
parent
5728b15141
commit
9d649c1fd0
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user