Repository: trafficserver Updated Branches: refs/heads/master 9859731bf -> 61aa4b477
Add a destructor for the HostDB regression test. Coverity CID #1022020 Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/61aa4b47 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/61aa4b47 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/61aa4b47 Branch: refs/heads/master Commit: 61aa4b477e1f7533267754e150990f48f4640194 Parents: 9859731 Author: Leif Hedstrom <[email protected]> Authored: Fri Jan 9 09:39:28 2015 -0700 Committer: Leif Hedstrom <[email protected]> Committed: Fri Jan 9 09:39:45 2015 -0700 ---------------------------------------------------------------------- iocore/hostdb/HostDB.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/61aa4b47/iocore/hostdb/HostDB.cc ---------------------------------------------------------------------- diff --git a/iocore/hostdb/HostDB.cc b/iocore/hostdb/HostDB.cc index 5f066d2..4dabe21 100644 --- a/iocore/hostdb/HostDB.cc +++ b/iocore/hostdb/HostDB.cc @@ -354,13 +354,21 @@ struct HostDBTestRR: public Continuation } -HostDBTestRR():Continuation(new_ProxyMutex()), nb(0), outstanding(0), success(0), failure(0), in(0) { + HostDBTestRR() + : Continuation(new_ProxyMutex()), nb(0), outstanding(0), success(0), failure(0), in(0) + { printf("starting HostDBTestRR....\n"); fd = open("hostdb_test.config", O_RDONLY, 0); ink_release_assert(fd >= 0); read_some(); SET_HANDLER(&HostDBTestRR::mainEvent); } + + ~HostDBTestRR() + { + if (fd) + close(fd); + } };
