BIND 10 master, updated. f7a26a8f9ee4adf64d754e6c2a6c07977854c40c Fix some memory leaks.
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Feb 6 16:41:25 UTC 2013
The branch, master has been updated
via f7a26a8f9ee4adf64d754e6c2a6c07977854c40c (commit)
from 89fbc1a1f41da33150176d8d0ba83ae8e88a03da (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit f7a26a8f9ee4adf64d754e6c2a6c07977854c40c
Author: Shane Kerr <shane at isc.org>
Date: Wed Feb 6 17:41:10 2013 +0100
Fix some memory leaks.
-----------------------------------------------------------------------
Summary of changes:
src/bin/auth/auth_config.cc | 2 +-
src/bin/auth/tests/config_unittest.cc | 2 +-
src/lib/util/unittests/fork.cc | 10 +++++-----
3 files changed, 7 insertions(+), 7 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/auth/auth_config.cc b/src/bin/auth/auth_config.cc
index e8592ac..de8325b 100644
--- a/src/bin/auth/auth_config.cc
+++ b/src/bin/auth/auth_config.cc
@@ -106,7 +106,7 @@ public:
rollbackAddresses_ = old;
}
virtual void commit() {
- rollbackAddresses_.release();
+ rollbackAddresses_.reset();
}
private:
AuthSrv& server_;
diff --git a/src/bin/auth/tests/config_unittest.cc b/src/bin/auth/tests/config_unittest.cc
index 830de0d..05c6cce 100644
--- a/src/bin/auth/tests/config_unittest.cc
+++ b/src/bin/auth/tests/config_unittest.cc
@@ -130,7 +130,7 @@ TEST_F(AuthConfigTest, invalidListenAddressConfig) {
isc::testutils::portconfig::invalidListenAddressConfig(server);
}
-// Try setting addresses trough config
+// Try setting addresses through config
TEST_F(AuthConfigTest, listenAddressConfig) {
isc::testutils::portconfig::listenAddressConfig(server);
diff --git a/src/lib/util/unittests/fork.cc b/src/lib/util/unittests/fork.cc
index 3414a3c..7ed22f8 100644
--- a/src/lib/util/unittests/fork.cc
+++ b/src/lib/util/unittests/fork.cc
@@ -93,10 +93,10 @@ provide_input(int *read_pipe, const void *input, const size_t length)
/*
* This creates a pipe, forks and reads the pipe and compares it
- * with given data. Used to check output of run in asynchronous way.
+ * with given data. Used to check output of run in an asynchronous way.
*/
pid_t
-check_output(int *write_pipe, const void *output, const size_t length)
+check_output(int *write_pipe, const void* const output, const size_t length)
{
int pipes[2];
if (pipe(pipes)) {
@@ -109,9 +109,7 @@ check_output(int *write_pipe, const void *output, const size_t length)
return pid;
} else {
close(pipes[1]);
- // We don't return the memory, but we're in tests and end this process
- // right away.
- unsigned char *buffer = new unsigned char[length + 1];
+ unsigned char* buffer = new unsigned char[length + 1];
// Try to read one byte more to see if the output ends here
size_t got_length(read_data(pipes[0], buffer, length + 1));
bool ok(true);
@@ -133,8 +131,10 @@ check_output(int *write_pipe, const void *output, const size_t length)
fprintf(stderr, "%02hhx", output_c[i]);
}
fprintf(stderr, "\n");
+ delete [] buffer;
exit(1);
} else {
+ delete [] buffer;
exit(0);
}
}
More information about the bind10-changes
mailing list