Skip to content

Commit

Permalink
appliead memory leak bugfix from orig repo PR
Browse files Browse the repository at this point in the history
  • Loading branch information
MightyPork committed Jan 27, 2017
1 parent 439df03 commit fba7cec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
12 changes: 7 additions & 5 deletions core/httpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -760,18 +760,20 @@ void ICACHE_FLASH_ATTR httpdRecvCb(ConnTypePtr rconn, char *remIp, int remPort,
int x, r;
char *p, *e;
httpdPlatLock();
char *sendBuff=malloc(HTTPD_MAX_SENDBUFF_LEN);
if (sendBuff==NULL) {
error("Malloc sendBuff failed!");

HttpdConnData *conn=httpdFindConnData(rconn, remIp, remPort);
if (conn==NULL) {
httpdPlatUnlock();
return;
}

HttpdConnData *conn=httpdFindConnData(rconn, remIp, remPort);
if (conn==NULL) {
char *sendBuff=malloc(HTTPD_MAX_SENDBUFF_LEN);
if (sendBuff==NULL) {
error("Malloc sendBuff failed!");
httpdPlatUnlock();
return;
}

conn->priv->sendBuff=sendBuff;
conn->priv->sendBuffLen=0;
conn->priv->corsToken[0] = 0;
Expand Down
1 change: 1 addition & 0 deletions espfs/espfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ EspFsFile ICACHE_FLASH_ATTR *espFsOpen(const char *fileName) {
#endif
} else {
error("[EspFS] Invalid compression: %d", h.compression);
free(r);
return NULL;
}
return r;
Expand Down

0 comments on commit fba7cec

Please sign in to comment.