diff --git a/lib/file.c b/lib/file.c index bce92bd2ab3f5b8c08c95f02a1401335fb8864a1..0bc0e4942748490dbd52246db7f1f2f2d1865936 100644 --- a/lib/file.c +++ b/lib/file.c @@ -149,6 +149,16 @@ CURLcode Curl_file_connect(struct connectdata *conn) } data->reqdata.proto.file = file; } + else { + /* file is not a protocol that can deal with "persistancy" */ + file = data->reqdata.proto.file; + Curl_safefree(file->freepath); + if(file->fd != -1) + close(file->fd); + file->path = NULL; + file->freepath = NULL; + file->fd = -1; + } #if defined(WIN32) || defined(MSDOS) || defined(__EMX__) /* If the first character is a slash, and there's