mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
from trunk: Fix use of freed memory in event_reinit; pointed out by Peter Postma
svn:r835
This commit is contained in:
parent
17515971a0
commit
38e97b143f
@ -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.
|
||||
|
2
event.c
2
event.c
@ -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__);
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user