mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-11 13:24:43 -04:00
Avoid double-close paths in http tests
Coverity spotted that there were some paths through the test functions that would double-close some sockets.
This commit is contained in:
parent
b6f15ccea6
commit
2578ec14f5
@ -734,6 +734,7 @@ http_delete_test(void *arg)
|
|||||||
|
|
||||||
bufferevent_free(bev);
|
bufferevent_free(bev);
|
||||||
evutil_closesocket(fd);
|
evutil_closesocket(fd);
|
||||||
|
fd = -1;
|
||||||
|
|
||||||
evhttp_free(http);
|
evhttp_free(http);
|
||||||
|
|
||||||
@ -2747,6 +2748,7 @@ http_incomplete_test_(struct basic_test_data *data, int use_timeout)
|
|||||||
bufferevent_free(bev);
|
bufferevent_free(bev);
|
||||||
if (use_timeout) {
|
if (use_timeout) {
|
||||||
evutil_closesocket(fd);
|
evutil_closesocket(fd);
|
||||||
|
fd = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
evhttp_free(http);
|
evhttp_free(http);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user