1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-12 01:53:07 +03:00

fixed memory leak

git-svn-id: svn://svn.code.sf.net/p/axtls/code/trunk@63 9a5d90b5-6617-0410-8a86-bb477d3ed2e3
This commit is contained in:
cameronrich
2007-02-18 08:14:01 +00:00
parent 61fd249441
commit 900b0eb96e
12 changed files with 100 additions and 84 deletions

View File

@ -163,9 +163,6 @@ static void procdirlisting(struct connstruct *cn)
send_error(cn, 404);
return;
}
/* Get rid of the "." */
readdir(cn->dirp);
#endif
snprintf(buf, sizeof(buf), "HTTP/1.1 200 OK\nContent-Type: text/html\n\n"
@ -198,6 +195,9 @@ void procdodir(struct connstruct *cn)
snprintf(buf, sizeof(buf), "</body></html>\n");
special_write(cn, buf, strlen(buf));
removeconnection(cn);
#ifndef WIN32
closedir(cn->dirp);
#endif
return;
}
@ -430,7 +430,7 @@ void procsendhead(struct connstruct *cn)
flags |= O_BINARY;
#endif
cn->filedesc = open(cn->actualfile, flags);
cn->filedesc = ax_open(cn->actualfile, flags);
if (cn->filedesc == -1)
{
send_error(cn, 404);
@ -1011,6 +1011,11 @@ static void send_error(struct connstruct *cn, int err)
title = "Not Found";
text = title;
break;
default:
title = "Unknown";
text = "Unknown";
break;
}
snprintf(buf, MAXREQUESTLENGTH, "HTTP/1.1 %d %s\n"