OSSP CVS Repository

ossp - Check-in [3232]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 3232
Date: 2003-Feb-11 21:24:42 (local)
2003-Feb-11 20:24:42 (UTC)
User:thl
Branch:
Comment: be more careful with free(3)
Tickets:
Inspections:
Files:
ossp-pkg/lmtp2nntp/lmtp2nntp_option.c      1.30 -> 1.31     2 inserted, 1 deleted

ossp-pkg/lmtp2nntp/lmtp2nntp_option.c 1.30 -> 1.31

--- lmtp2nntp_option.c   2003/02/11 12:55:31     1.30
+++ lmtp2nntp_option.c   2003/02/11 20:24:42     1.31
@@ -316,7 +316,8 @@
         }
         if ((option_find(o, i, &ocp) == OPTION_OK) && (ocp->cb != NULL)) {
             rv = ocp->cb(ocp, cp = (ocp->type == OPT_FLAG ? NULL : (char *)popt_getoptarg(poptCon)), ocp->cbctx);
-            free(cp); /* TODO this should be the task of popt_freecontext but debugging showed popt does not free(3) */
+            if (cp != NULL)
+                free(cp); /* TODO this should be the task of popt_freecontext but debugging showed popt does not free(3) */
             if (rc == OPTION_OK)
                 rc = rv;
         }

CVSTrac 2.0.1