mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-08 11:53:00 -04:00
Fix use of freed memory in event_reinit; pointed out by Peter Postma
svn:r834
This commit is contained in:
parent
bc5e27190f
commit
134344b79e
@ -100,6 +100,7 @@ Changes in current version:
|
||||
o provide a method for canceling ongoing http requests.
|
||||
o Make vsnprintf() returns consistent on win32.
|
||||
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.0:
|
||||
o allow \r or \n individually to separate HTTP headers instead of the standard "\r\n"; from Charles Kerr.
|
||||
|
2
event.c
2
event.c
@ -334,7 +334,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__);
|
||||
|
@ -499,12 +499,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 */
|
||||
@ -517,8 +519,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