]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2916] corrected handling of aux socket wrt exception safety
authorJINMEI Tatuya <jinmei@isc.org>
Wed, 15 May 2013 18:31:57 +0000 (11:31 -0700)
committerJINMEI Tatuya <jinmei@isc.org>
Wed, 15 May 2013 18:31:57 +0000 (11:31 -0700)
src/lib/asiolink/tests/local_socket_unittest.cc

index 57828d0b0f34ac77e7633107b9ad72facc930fbd..b851ca3ad1c5b9e2250a66f13465419b616ad496 100644 (file)
@@ -200,7 +200,8 @@ TEST_F(LocalSocketTest, asyncPartialRead) {
     ScopedSocket aux_sockpair[2];
     aux_sockpair[0].set(socks[0]);
     aux_sockpair[1].set(socks[1]);
-    LocalSocket aux_sock(io_service_, aux_sockpair[0].release());
+    LocalSocket aux_sock(io_service_, aux_sockpair[0].get());
+    aux_sockpair[0].release();  // on successful construction we should release
     bool aux_callback_called = false;
     aux_sock.asyncRead(boost::bind(&callback, _1, &io_service_,
                                    &aux_callback_called, false), &ch, 1);