Loading lib/ftp.c +12 −7 Original line number Diff line number Diff line Loading @@ -129,7 +129,7 @@ struct curl_slist *curl_slist_append(struct curl_slist *list, char *data) } else { fprintf(stderr, "Cannot allocate memory for QUOTE list.\n"); exit(-1); return NULL; } if (list) { Loading Loading @@ -584,11 +584,6 @@ CURLcode ftp_done(struct connectdata *conn) } } if(ftp->file) free(ftp->file); if(ftp->dir) free(ftp->dir); free(ftp); data->proto.ftp=NULL; /* it is gone */ Loading Loading @@ -1406,13 +1401,15 @@ CURLcode ftp(struct connectdata *conn) it */ ftp->file = strrchr(conn->ppath, '/'); if(ftp->file) { if(ftp->file != conn->ppath) dirlength=ftp->file-conn->ppath; /* don't count the traling slash */ ftp->file++; /* point to the first letter in the file name part or remain NULL */ } else { ftp->file = conn->ppath; /* there's only a file part */ } dirlength=ftp->file-conn->ppath; if(*ftp->file) { ftp->file = curl_unescape(ftp->file, 0); Loading Loading @@ -1440,6 +1437,14 @@ CURLcode ftp(struct connectdata *conn) retcode = _ftp(conn); /* clean up here, success or error doesn't matter */ if(ftp->file) free(ftp->file); if(ftp->dir) free(ftp->dir); ftp->file = ftp->dir = NULL; /* zero */ return retcode; } Loading
lib/ftp.c +12 −7 Original line number Diff line number Diff line Loading @@ -129,7 +129,7 @@ struct curl_slist *curl_slist_append(struct curl_slist *list, char *data) } else { fprintf(stderr, "Cannot allocate memory for QUOTE list.\n"); exit(-1); return NULL; } if (list) { Loading Loading @@ -584,11 +584,6 @@ CURLcode ftp_done(struct connectdata *conn) } } if(ftp->file) free(ftp->file); if(ftp->dir) free(ftp->dir); free(ftp); data->proto.ftp=NULL; /* it is gone */ Loading Loading @@ -1406,13 +1401,15 @@ CURLcode ftp(struct connectdata *conn) it */ ftp->file = strrchr(conn->ppath, '/'); if(ftp->file) { if(ftp->file != conn->ppath) dirlength=ftp->file-conn->ppath; /* don't count the traling slash */ ftp->file++; /* point to the first letter in the file name part or remain NULL */ } else { ftp->file = conn->ppath; /* there's only a file part */ } dirlength=ftp->file-conn->ppath; if(*ftp->file) { ftp->file = curl_unescape(ftp->file, 0); Loading Loading @@ -1440,6 +1437,14 @@ CURLcode ftp(struct connectdata *conn) retcode = _ftp(conn); /* clean up here, success or error doesn't matter */ if(ftp->file) free(ftp->file); if(ftp->dir) free(ftp->dir); ftp->file = ftp->dir = NULL; /* zero */ return retcode; }