from trunk: Fix use of freed memory in event_reinit; pointed out by Peter Postma

svn:r835
This commit is contained in:
Niels Provos 2008-05-16 01:58:05 +00:00
parent 17515971a0
commit 38e97b143f
3 changed files with 7 additions and 4 deletions

View File

@ -1,5 +1,6 @@
Changes in 1.4.5-stable:
o Fix connection keep-alive behavior for HTTP/1.0
o Fix use of freed memory in event_reinit; pointed out by Peter Postma
Changes in 1.4.4-stable:
o Correct the documentation on buffer printf functions.

View File

@ -275,7 +275,7 @@ event_reinit(struct event_base *base)
if (base->evsel->dealloc != NULL)
base->evsel->dealloc(base, base->evbase);
base->evbase = evsel->init(base);
evbase = base->evbase = evsel->init(base);
if (base->evbase == NULL)
event_errx(1, "%s: could not reinitialize event mechanism",
__func__);

View File

@ -472,12 +472,14 @@ test_fork(void)
exit(1);
}
called = 0;
event_dispatch();
/* we do not send an EOF; simple_read_cb requires an EOF
* to set test_ok. we just verify that the callback was
* called. */
exit(test_ok != 0 || called != 2);
exit(test_ok != 0 || called != 2 ? -2 : 76);
}
/* wait for the child to read the data */
@ -490,8 +492,8 @@ test_fork(void)
exit(1);
}
if (WEXITSTATUS(status) != 0) {
fprintf(stderr, "FAILED (exit)\n");
if (WEXITSTATUS(status) != 76) {
fprintf(stderr, "FAILED (exit): %d\n", WEXITSTATUS(status));
exit(1);
}