Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F173367710
D60017.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
895 B
Referenced Files
None
Subscribers
None
D60017.diff
View Options
diff --git a/lib/libfetch/ftp.c b/lib/libfetch/ftp.c
--- a/lib/libfetch/ftp.c
+++ b/lib/libfetch/ftp.c
@@ -1053,7 +1053,7 @@
/* connect to server */
if ((conn = ftp_connect(url, purl, flags)) == NULL)
return (NULL);
- if (cached_connection)
+ if (cached_connection != NULL)
ftp_disconnect(cached_connection);
cached_connection = fetch_ref(conn);
memcpy(&cached_host, url, sizeof(*url));
@@ -1100,6 +1100,7 @@
struct url *purl, const char *flags)
{
conn_t *conn;
+ FILE *f;
int oflag;
/* check if we should use HTTP instead */
@@ -1144,9 +1145,12 @@
oflag = O_RDONLY;
/* initiate the transfer */
- return (ftp_transfer(conn, op, url->doc, oflag, url->offset, flags));
-
+ f = ftp_transfer(conn, op, url->doc, oflag, url->offset, flags);
+ if (f == NULL)
+ goto errsock;
+ return (f);
errsock:
+ fetch_deref(conn);
ftp_disconnect(conn);
return (NULL);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Sep 26, 12:05 PM (3 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39658901
Default Alt Text
D60017.diff (895 B)
Attached To
Mode
D60017: libfetch: Plug connection leaks in FTP code
Attached
Detach File
Event Timeline
Log In to Comment