BIND 10 trac2272, updated. 37038754b11cb07ea6dfc8291586a5a5e6c4d5f8 [2272] Throw exception if allocation with new fails.

BIND 10 source code commits bind10-changes at lists.isc.org
Mon Sep 24 18:37:39 UTC 2012


The branch, trac2272 has been updated
       via  37038754b11cb07ea6dfc8291586a5a5e6c4d5f8 (commit)
      from  3d13f1625ffb635f629944e8a1c0e793804d0112 (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 37038754b11cb07ea6dfc8291586a5a5e6c4d5f8
Author: Marcin Siodelski <marcin at isc.org>
Date:   Mon Sep 24 19:14:27 2012 +0200

    [2272] Throw exception if allocation with new fails.

-----------------------------------------------------------------------

Summary of changes:
 .../tools/perfdhcp/tests/command_options_helper.h  |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

-----------------------------------------------------------------------
diff --git a/tests/tools/perfdhcp/tests/command_options_helper.h b/tests/tools/perfdhcp/tests/command_options_helper.h
index b0249c8..2fc70ea 100644
--- a/tests/tools/perfdhcp/tests/command_options_helper.h
+++ b/tests/tools/perfdhcp/tests/command_options_helper.h
@@ -102,6 +102,7 @@ private:
     ///
     /// \param text_to_split string to be splited.
     /// \param [out] num number of substrings returned.
+    /// \param std::bad_alloc if allocation of C-strings failed.
     /// \return array of C-strings created from split.
     static char** tokenizeString(const std::string& text_to_split, int& num) {
         char** results = NULL;
@@ -115,13 +116,11 @@ private:
 
         if (tokens.size() > 0) {
             // Allocate array of C-strings where we will store tokens
-            results = new (std::nothrow) char*[tokens.size()];
-            assert(results != NULL);
+            results = new char*[tokens.size()];
             // Store tokens in C-strings array
             for (int i = 0; i < tokens.size(); ++i) {
                 size_t cs_size = tokens[i].length() + 1;
-                char* cs = new (std::nothrow) char[cs_size];
-                assert (cs != NULL);
+                char* cs = new char[cs_size];
                 strncpy(cs, tokens[i].c_str(), cs_size);
                 assert(cs[cs_size - 1] == '\0');
                 results[i] = cs;



More information about the bind10-changes mailing list