mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-08 11:53:00 -04:00
Fix infrequent memory leak in bufferevent_init_common().
This commit is contained in:
parent
b557b175c0
commit
83986414b0
@ -267,6 +267,10 @@ bufferevent_init_common(struct bufferevent_private *bufev_private,
|
||||
if (options & BEV_OPT_THREADSAFE) {
|
||||
if (bufferevent_enable_locking(bufev, NULL) < 0) {
|
||||
/* cleanup */
|
||||
evbuffer_free(bufev->input);
|
||||
evbuffer_free(bufev->output);
|
||||
bufev->input = NULL;
|
||||
bufev->output = NULL;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user