Skip to content

Commit

Permalink
Fix memleak in regress tests
Browse files Browse the repository at this point in the history
  • Loading branch information
widgetii committed Oct 4, 2022
1 parent 10ed1f1 commit aa163a4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/regress_http.c
Original file line number Diff line number Diff line change
Expand Up @@ -3615,7 +3615,7 @@ http_incomplete_test_(struct basic_test_data *data, int use_timeout, int ssl)
tt_assert(fd != EVUTIL_INVALID_SOCKET);

/* Stupid thing to send a request */
bev = create_bev(data->base, fd, ssl, 0);
bev = create_bev(data->base, fd, ssl, BEV_OPT_CLOSE_ON_FREE);
bufferevent_setcb(bev,
http_incomplete_readcb, http_incomplete_writecb,
http_incomplete_errorcb, use_timeout ? NULL : &fd);
Expand Down Expand Up @@ -4007,7 +4007,7 @@ http_stream_out_test_impl(void *arg, int ssl)
test_ok = 0;
exit_base = data->base;

bev = create_bev(data->base, -1, ssl, 0);
bev = create_bev(data->base, -1, ssl, BEV_OPT_CLOSE_ON_FREE);
evcon = evhttp_connection_base_bufferevent_new(
data->base, NULL, bev, "127.0.0.1", port);
tt_assert(evcon);
Expand Down Expand Up @@ -4207,7 +4207,7 @@ http_connection_fail_test_impl(void *arg, int ssl)
/* auto detect a port */
evhttp_free(http);

bev = create_bev(data->base, -1, ssl, 0);
bev = create_bev(data->base, -1, ssl, BEV_OPT_CLOSE_ON_FREE);
/* Pick an unroutable address. This administratively scoped multicast
* address should do when working with TCP. */
evcon = evhttp_connection_base_bufferevent_new(
Expand Down Expand Up @@ -4279,7 +4279,7 @@ http_simple_test_impl(void *arg, int ssl, int dirty, const char *uri)
exit_base = data->base;
test_ok = 0;

bev = create_bev(data->base, -1, ssl, 0);
bev = create_bev(data->base, -1, ssl, BEV_OPT_CLOSE_ON_FREE);
#ifdef EVENT__HAVE_OPENSSL
bufferevent_openssl_set_allow_dirty_shutdown(bev, dirty);
#endif
Expand Down Expand Up @@ -4359,7 +4359,7 @@ https_per_socket_bevcb_impl(void *arg, ev_uint16_t http_port, ev_uint16_t https_

evhttp_set_gencb(http, http_basic_cb, http);

bev = create_bev(data->base, -1, mask, 0);
bev = create_bev(data->base, -1, mask, BEV_OPT_CLOSE_ON_FREE);

#ifdef EVENT__HAVE_OPENSSL
bufferevent_openssl_set_allow_dirty_shutdown(bev, 1);
Expand Down Expand Up @@ -5204,7 +5204,7 @@ http_write_during_read_test_impl(void *arg, int ssl)

fd = http_connect("127.0.0.1", port);
tt_assert(fd != EVUTIL_INVALID_SOCKET);
bev = create_bev(data->base, fd, ssl, 0);
bev = create_bev(data->base, fd, ssl, BEV_OPT_CLOSE_ON_FREE);
bufferevent_setcb(bev, NULL, NULL, NULL, data->base);
bufferevent_disable(bev, EV_READ);

Expand Down

0 comments on commit aa163a4

Please sign in to comment.