mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 06:13:31 +01:00
Fix bug 1001
For compatibility with Libevent2, tor_event_new should accept a NULL base without crashing.
This commit is contained in:
parent
bdd5785f07
commit
0caf8dd0b6
@ -114,6 +114,8 @@ tor_event_new(struct event_base *base, int sock, short what,
|
|||||||
{
|
{
|
||||||
struct event *e = tor_malloc_zero(sizeof(struct event));
|
struct event *e = tor_malloc_zero(sizeof(struct event));
|
||||||
event_set(e, sock, what, cb, arg);
|
event_set(e, sock, what, cb, arg);
|
||||||
|
if (! base)
|
||||||
|
base = tor_libevent_get_base();
|
||||||
event_base_set(base, e);
|
event_base_set(base, e);
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user