use static buffer

SVN revision: 43510
This commit is contained in:
Vincent Torri 2009-11-07 07:09:06 +00:00
parent 9db696ae0d
commit ae64144bc5
1 changed files with 2 additions and 5 deletions

View File

@ -774,10 +774,9 @@ ecore_con_url_ftp_upload(Ecore_Con_Url *url_con, const char *filename, const cha
if (!url_con->url) return 0; if (!url_con->url) return 0;
if (filename) if (filename)
{ {
char *tmp; char tmp[PATH_MAX];
tmp = strdup(filename); snprintf(tmp, PATH_MAX, "%s", filename);
if (!tmp) return 0;
if (stat(filename, &file_info)) return 0; if (stat(filename, &file_info)) return 0;
fd = fopen(filename, "rb"); fd = fopen(filename, "rb");
@ -797,8 +796,6 @@ ecore_con_url_ftp_upload(Ecore_Con_Url *url_con, const char *filename, const cha
curl_easy_setopt(url_con->curl_easy, CURLOPT_READDATA, fd); curl_easy_setopt(url_con->curl_easy, CURLOPT_READDATA, fd);
ecore_con_url_url_set(url_con, url); ecore_con_url_url_set(url_con, url);
free(tmp);
return _ecore_con_url_perform(url_con); return _ecore_con_url_perform(url_con);
} }
else else