summaryrefslogtreecommitdiffstats
path: root/lib/libfetch/ftp.c
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2002-06-11 11:27:28 +0000
committerdes <des@FreeBSD.org>2002-06-11 11:27:28 +0000
commit5064d0b266233c22e85f5845aaf1aa68ebee7d88 (patch)
treec30b6b79c2759e3145ef6c2364abfc4c383dfb65 /lib/libfetch/ftp.c
parentf85d0f00609e74ecc0af9af261884345400f1483 (diff)
downloadFreeBSD-src-5064d0b266233c22e85f5845aaf1aa68ebee7d88.zip
FreeBSD-src-5064d0b266233c22e85f5845aaf1aa68ebee7d88.tar.gz
Add a reference count to struct fetchconn so we don't prematurely close and
free a cached FTP connection.
Diffstat (limited to 'lib/libfetch/ftp.c')
-rw-r--r--lib/libfetch/ftp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libfetch/ftp.c b/lib/libfetch/ftp.c
index 7b1bece..e703a01 100644
--- a/lib/libfetch/ftp.c
+++ b/lib/libfetch/ftp.c
@@ -874,7 +874,7 @@ _ftp_cached_connect(struct url *url, struct url *purl, const char *flags)
return (NULL);
if (cached_connection)
_ftp_disconnect(cached_connection);
- cached_connection = conn;
+ cached_connection = _fetch_ref(conn);
memcpy(&cached_host, url, sizeof *url);
return (conn);
}
OpenPOWER on IntegriCloud