Skip to content

Commit

Permalink
Merge pull request contiki-os#2164 from alexstanoev/web-demo-crash-fix
Browse files Browse the repository at this point in the history
Zero out httpd_state before deallocating
  • Loading branch information
g-oikonomou authored Apr 1, 2017
2 parents 12f1721 + a303641 commit 6eac731
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions examples/cc26xx/cc26xx-web-demo/httpd-simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -1268,9 +1268,7 @@ appcall(void *state)

if(uip_closed() || uip_aborted() || uip_timedout()) {
if(s != NULL) {
s->script = NULL;
s->blen = 0;
s->tmp_buf_len = 0;
memset(s, 0, sizeof(struct httpd_state));
memb_free(&conns, s);
}
} else if(uip_connected()) {
Expand All @@ -1291,7 +1289,7 @@ appcall(void *state)
if(uip_poll()) {
if(timer_expired(&s->timer)) {
uip_abort();
s->script = NULL;
memset(s, 0, sizeof(struct httpd_state));
memb_free(&conns, s);
}
} else {
Expand Down

0 comments on commit 6eac731

Please sign in to comment.