mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-08 03:44:22 -04:00
Fix two use-after-free bugs in unit tests spoted by lock debugging
This commit is contained in:
parent
76cd2b70bb
commit
d84d8385cd
@ -1185,11 +1185,11 @@ test_loopexit_multiple(void)
|
||||
|
||||
event_base_dispatch(base);
|
||||
|
||||
event_base_free(base);
|
||||
|
||||
tt_assert(event_base_got_exit(base));
|
||||
tt_assert(!event_base_got_break(base));
|
||||
|
||||
event_base_free(base);
|
||||
|
||||
test_ok = 1;
|
||||
|
||||
end:
|
||||
|
@ -217,15 +217,15 @@ basic_test_cleanup(const struct testcase_t *testcase, void *ptr)
|
||||
EVUTIL_CLOSESOCKET(data->pair[1]);
|
||||
}
|
||||
|
||||
if (testcase->flags & TT_NEED_DNS) {
|
||||
evdns_shutdown(0);
|
||||
}
|
||||
|
||||
if (testcase->flags & TT_NEED_BASE) {
|
||||
if (data->base)
|
||||
event_base_free(data->base);
|
||||
}
|
||||
|
||||
if (testcase->flags & TT_NEED_DNS) {
|
||||
evdns_shutdown(0);
|
||||
}
|
||||
|
||||
free(data);
|
||||
|
||||
return 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user