]> granicus.if.org Git - libevent/commitdiff
Avoid double-close paths in http tests
authorNick Mathewson <nickm@torproject.org>
Thu, 13 Mar 2014 14:46:59 +0000 (10:46 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 13 Mar 2014 14:46:59 +0000 (10:46 -0400)
Coverity spotted that there were some paths through the test
functions that would double-close some sockets.

test/regress_http.c

index 982915006bee7430f3dfd37aea7c1ccbbea89651..0de22565d027d7ee5de05b368a0c116aea15c6cc 100644 (file)
@@ -734,6 +734,7 @@ http_delete_test(void *arg)
 
        bufferevent_free(bev);
        evutil_closesocket(fd);
+       fd = -1;
 
        evhttp_free(http);
 
@@ -2747,6 +2748,7 @@ http_incomplete_test_(struct basic_test_data *data, int use_timeout)
        bufferevent_free(bev);
        if (use_timeout) {
                evutil_closesocket(fd);
+               fd = -1;
        }
 
        evhttp_free(http);