]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2375] Use safety measures
authorMichal 'vorner' Vaner <michal.vaner@nic.cz>
Mon, 19 Nov 2012 16:33:08 +0000 (17:33 +0100)
committerMichal 'vorner' Vaner <michal.vaner@nic.cz>
Mon, 19 Nov 2012 16:34:09 +0000 (17:34 +0100)
A scoped pointer, in this case. It probably isn't safer, as the ->handle
couldn't throw in this case, but just for the habit.

src/lib/dns/tests/master_lexer_unittest.cc

index 2eb0c3a9ae654f7d0c54fe9c35ae1ac957e2e816..1c6e77549ac971ece3a3340a331cf93052abb06d 100644 (file)
@@ -178,9 +178,9 @@ TEST_F(MasterLexerTest, tokenFromStart) {
             // We don't have access directly inside the implementation.
             // We get the fake state, run it to install the token.
             // Then we just delete it ourself and return NULL.
-            State* state(State::getFakeState(NULL, 0, &token_));
+            scoped_ptr<const State> state(State::getFakeState(NULL, 0,
+                                                              &token_));
             state->handle(*this);
-            delete state;
             return (NULL);
         }
     private: