Index: trunk/src/VBox/NetworkServices/Dhcpd/Config.cpp
===================================================================
--- trunk/src/VBox/NetworkServices/Dhcpd/Config.cpp	(revision 79553)
+++ trunk/src/VBox/NetworkServices/Dhcpd/Config.cpp	(revision 79563)
@@ -88,5 +88,5 @@
  * @returns IPRT status code.
  */
-int Config::i_init()
+int Config::i_init() RT_NOEXCEPT
 {
     return i_homeInit();
@@ -100,5 +100,5 @@
  * @todo Too many init functions?
  */
-int Config::i_homeInit()
+int Config::i_homeInit() RT_NOEXCEPT
 {
     char szHome[RTPATH_MAX];
@@ -121,5 +121,5 @@
  * @returns Config instance on success, NULL on failure.
  */
-/*static*/ Config *Config::i_createInstanceAndCallInit()
+/*static*/ Config *Config::i_createInstanceAndCallInit() RT_NOEXCEPT
 {
     Config *pConfig;
@@ -161,4 +161,6 @@
  * Interal worker for i_setNetwork() that sets m_strBaseName to sanitized the
  * version of m_strNetwork suitable for use as a path component.
+ *
+ * @throws std::bad_alloc
  */
 void Config::i_sanitizeBaseName()
@@ -196,5 +198,5 @@
  * @todo make the log file directly configurable?
  */
-int Config::i_logInit()
+int Config::i_logInit() RT_NOEXCEPT
 {
     if (m_strHome.isEmpty() || m_strBaseName.isEmpty())
@@ -241,5 +243,5 @@
  * Post process and validate the configuration after it has been loaded.
  */
-int Config::i_complete()
+int Config::i_complete() RT_NOEXCEPT
 {
     if (m_strNetwork.isEmpty())
@@ -336,5 +338,5 @@
 
 
-/*static*/ Config *Config::hardcoded()
+/*static*/ Config *Config::hardcoded() RT_NOEXCEPT
 {
     std::unique_ptr<Config> config(i_createInstanceAndCallInit());
@@ -378,5 +380,9 @@
 
 
-
+/**
+ * Old VBoxNetDHCP style command line parsing.
+ *
+ * @throws std::bad_alloc
+ */
 /*static*/ Config *Config::compat(int argc, char **argv)
 {
@@ -519,11 +525,10 @@
 
 
-Config *Config::create(int argc, char **argv)
-{
-#define DHCPD_GETOPT_COMMENT 256 /* No short option for --comment */
+Config *Config::create(int argc, char **argv) RT_NOEXCEPT
+{
     static const RTGETOPTDEF s_aOptions[] =
     {
-        { "--config",       'c',                  RTGETOPT_REQ_STRING },
-        { "--comment",      DHCPD_GETOPT_COMMENT, RTGETOPT_REQ_STRING }
+        { "--config",       'c', RTGETOPT_REQ_STRING },
+        { "--comment",      '#', RTGETOPT_REQ_STRING }
     };
 
@@ -556,5 +561,5 @@
                 break;
 
-            case DHCPD_GETOPT_COMMENT: /* --comment */
+            case '#': /* --comment */
                 /* The sole purpose of this option is to allow identification of DHCP
                  * server instances in the process list. We ignore the required string
@@ -589,5 +594,5 @@
  * @note The release log has is not operational when this method is called.
  */
-Config *Config::i_read(const char *pszFileName)
+Config *Config::i_read(const char *pszFileName) RT_NOEXCEPT
 {
     if (pszFileName == NULL || pszFileName[0] == '\0')
@@ -635,4 +640,10 @@
         return NULL;
     }
+    catch (std::bad_alloc &)
+    {
+        LogFunc(("std::bad_alloc\n"));
+        RTMsgError("std::bad_alloc reading config\n");
+        return NULL;
+    }
     catch (...)
     {
@@ -650,5 +661,6 @@
  * below it.
  *
- * @throws stuff.
+ * @param   pElmRoot    The root element.
+ * @throws  std::bad_alloc, ConfigFileError
  */
 void Config::i_parseConfig(const xml::ElementNode *pElmRoot)
@@ -694,5 +706,5 @@
  *
  * @param   pElmServer          The DHCPServer element.
- * @throws  ConfigFileError
+ * @throws  std::bad_alloc, ConfigFileError
  */
 void Config::i_parseServer(const xml::ElementNode *pElmServer)
@@ -767,5 +779,5 @@
  *
  * @param   pElmServer          The <Options> element.
- * @throws  ConfigFileError
+ * @throws  std::bad_alloc, ConfigFileError
  */
 void Config::i_parseGlobalOptions(const xml::ElementNode *options)
@@ -792,5 +804,5 @@
  *
  * @param   pElmServer          The <Config> element.
- * @throws  ConfigFileError
+ * @throws  std::bad_alloc, ConfigFileError
  */
 void Config::i_parseVMConfig(const xml::ElementNode *pElmConfig)
@@ -841,5 +853,5 @@
  * @param   pElmServer          The <Option> element.
  * @param   optmap              The option map to add the option to.
- * @throws  ConfigFileError
+ * @throws  std::bad_alloc, ConfigFileError
  */
 void Config::i_parseOption(const xml::ElementNode *pElmOption, optmap_t &optmap)
@@ -946,4 +958,6 @@
  * @param   idVendorClass   The vendor class ID.
  * @param   idUserClass     The user class ID.
+ *
+ * @throws  std::bad_alloc
  */
 optmap_t &Config::getOptions(optmap_t &a_rRetOpts, const OptParameterRequest &reqOpts, const ClientId &id,
