OSSP CVS Repository

ossp - Difference in ossp-pkg/lmtp2nntp/lmtp2nntp_option.c versions 1.23 and 1.24
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/lmtp2nntp/lmtp2nntp_option.c 1.23 -> 1.24

--- lmtp2nntp_option.c   2003/01/30 19:45:20     1.23
+++ lmtp2nntp_option.c   2003/02/10 14:24:16     1.24
@@ -226,9 +226,18 @@
         }
     }
     catch(ex) {
+        int i;
         if (v.oc != NULL) {
             if (type == OPT_SINGLE && v.oc->data.s != NULL)
                 free(v.oc->data.s);
+            if (type == OPT_MULTI  && v.oc->data.m != NULL) {
+                for (i = 0; i < v.oc->ndata; i++)
+                    if (v.oc->data.m[i] == NULL)
+                        break;
+                    else
+                        free(v.oc->data.m[i]);
+                free(v.oc->data.m);
+            }
             if (v.oc->argdescrip != NULL)
                 free(v.oc->argdescrip);
             if (v.oc->descrip != NULL)
@@ -594,6 +603,7 @@
 lmtp2nntp_option_rc_t option_destroy(lmtp2nntp_option_t *o)
 {
     optionval_t *oc;
+    optionval_t *ocn;
     int i;
 
     if (o == NULL)
@@ -612,7 +622,15 @@
                     free(oc->data.m[i]);
             free(oc->data.m);
         }
-        oc = oc->next;
+        if (oc->argdescrip != NULL)
+            free(oc->argdescrip);
+        if (oc->descrip != NULL)
+            free(oc->descrip);
+        if (oc->longname != NULL)
+            free(oc->longname);
+        ocn = oc->next;
+        free(oc);
+        oc = ocn;
     }
     if (o->vo != NULL)
         val_destroy(o->vo);

CVSTrac 2.0.1