OSSP CVS Repository

ossp - Difference in ossp-pkg/rc/rc_opt.c versions 1.9 and 1.10
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/rc/rc_opt.c 1.9 -> 1.10

--- rc_opt.c     2003/07/07 13:30:51     1.9
+++ rc_opt.c     2003/07/08 15:09:50     1.10
@@ -33,6 +33,7 @@
 
 #include "rc.h"
 
+/* FIXME mlelstv -- why Construct/Destruct vs. New/Delete ? */
 
 /***************************************
 * optConstruct(rc_opt_t **)            *
@@ -58,6 +59,7 @@
 rc_return_t optGetname(rc_opt_t *pOption, char **pszName)
 {
     assert(pOption && pOption->szName);
+    /* FIXME mlelstv -- why non-shared read ? */
     if (!(*pszName = strdup(pOption->szName)))  /* Get name from option     */
         return(RC_THROW(RC_ERR_MEM));
     else
@@ -67,6 +69,7 @@
 rc_return_t optGetval(rc_opt_t *pOption, char **pszVal)
 {
     assert(pOption && pOption->szVal);
+    /* FIXME mlelstv -- why non-shared read ? */
     if (!(*pszVal = strdup(pOption->szVal)))    /* Get value from option    */
         return(RC_THROW(RC_ERR_MEM));
     else
@@ -103,19 +106,14 @@
 ***************************************/
 rc_return_t optDestruct(rc_opt_t **ppOption)
 {
-    ex_t Except;
+    assert(*ppOption);              /* Error if not constructed */
 
-    assert(*ppOption);                  /* Error if not constructed */
-    try {
-        if ((*ppOption)->szName)        /* Might not be mallocd yet */
-            free((*ppOption)->szName);
-        if ((*ppOption)->szVal)         /* Might not be mallocd yet */
-            free((*ppOption)->szVal);
-        free(*ppOption);                /* Deallocate option and    */
-        *ppOption = NULL;               /* clear its reference      */
-    }
-    catch(Except)
-        rethrow;
+    if ((*ppOption)->szName)        /* Might not be mallocd yet */
+        free((*ppOption)->szName);
+    if ((*ppOption)->szVal)         /* Might not be mallocd yet */
+        free((*ppOption)->szVal);
+    free(*ppOption);                /* Deallocate option and    */
+    *ppOption = NULL;               /* clear its reference      */
 
     return(RC_THROW(RC_OK));
 }

CVSTrac 2.0.1