http_server: Fixed memory leak on unittest code.

Two P2PHTttpServer tests (ReportServerMessageTest and
MultipleConnections) create ConnectionDelegates using the
FakeConnectionDelegate class. The real implementation deletes itself
(delete this;) when Run() is done, since we don't track which
ConnectionDelegates are still running.

The FakeConnectionDelegate didn't have this delete, leaking that
memory on the tests that used Construct(). This leak existed only
in unittest code.

TEST=ASAN_OPTIONS="detect_leaks=1" USE="clang asan" FEATURES="test" \
     emerge-amd64-generic p2p passes.
TEST=Added log message before the added "delete this" to check correlation with the leak.

Change-Id: I55429de6c495e8fe21e09abbae2ae8738035ae93
Tested-by: Alex Deymo <>
Reviewed-by: David Zeuthen <>
Reviewed-by: Yunlian Jiang <>
Commit-Queue: Alex Deymo <>
2 files changed