Try to fix issues reported by coverity

This commit is contained in:
goldsimon
2018-02-13 12:08:13 +01:00
parent d5d635cdce
commit e20e9bc3d4
8 changed files with 24 additions and 28 deletions

View File

@@ -1728,7 +1728,11 @@ http_post_rxpbuf(struct http_state *hs, struct pbuf *p)
/* prevent connection being closed if httpd_post_data_recved() is called nested */
hs->unrecved_bytes++;
#endif
err = httpd_post_receive_data(hs, p);
if (p != NULL) {
err = httpd_post_receive_data(hs, p);
} else {
err = ERR_OK;
}
#if LWIP_HTTPD_SUPPORT_POST && LWIP_HTTPD_POST_MANUAL_WND
hs->unrecved_bytes--;
#endif

View File

@@ -763,6 +763,7 @@ static int checkSsiByFilelist(const char* filename_listfile)
fclose(f);
if ((readcount > fsize) || !readcount) {
printf("failed to read data from ssi file\n");
free(buf);
return 0;
}
@@ -780,6 +781,7 @@ static int checkSsiByFilelist(const char* filename_listfile)
lines = (char**)malloc(sizeof(char*) * num_lines);
if (!lines) {
printf("failed to allocate ssi line buffer\n");
free(buf);
return 0;
}
memset(lines, 0, sizeof(char*) * num_lines);