Send Linux-ha-cvs mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Linux-ha-cvs digest..."


Today's Topics:

   1. Linux-HA CVS: heartbeat by lars from 
      ([email protected])
   2. Linux-HA CVS: heartbeat by lars from 
      ([email protected])
   3. Linux-HA CVS: heartbeat by lars from 
      ([email protected])
   4. Linux-HA CVS: lib by lars from  ([email protected])


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

Message: 1
Date: Fri,  7 Apr 2006 06:51:26 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: heartbeat by lars from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : lars
Host    : 
Project : linux-ha
Module  : heartbeat

Dir     : linux-ha/heartbeat


Modified Files:
        heartbeat.c 


Log Message:
CID #25: RESOURCE_LEAK, fp was not being freed.

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/heartbeat/heartbeat.c,v
retrieving revision 1.499
retrieving revision 1.500
diff -u -3 -r1.499 -r1.500
--- heartbeat.c 3 Mar 2006 05:36:31 -0000       1.499
+++ heartbeat.c 7 Apr 2006 12:51:25 -0000       1.500
@@ -2,7 +2,7 @@
  * TODO:
  * 1) Man page update
  */
-/* $Id: heartbeat.c,v 1.499 2006/03/03 05:36:31 zhenh Exp $ */
+/* $Id: heartbeat.c,v 1.500 2006/04/07 12:51:25 lars Exp $ */
 /*
  * heartbeat: Linux-HA heartbeat code
  *
@@ -6093,6 +6093,9 @@
                }
        }
        cl_log(LOG_INFO, "WARNING: Above Options Now Enabled.");
+       
+       fclose(fp);
+       
        return something_changed;
 }
 
@@ -6233,6 +6236,9 @@
 
 /*
  * $Log: heartbeat.c,v $
+ * Revision 1.500  2006/04/07 12:51:25  lars
+ * CID #25: RESOURCE_LEAK, fp was not being freed.
+ *
  * Revision 1.499  2006/03/03 05:36:31  zhenh
  * The should_drop_message() may call itself in some special conditions.
  * So the t->last_seq should be set before any chance to call itself




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

Message: 2
Date: Fri,  7 Apr 2006 07:00:15 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: heartbeat by lars from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : lars
Host    : 
Project : linux-ha
Module  : heartbeat

Dir     : linux-ha/heartbeat


Modified Files:
        findif.c 


Log Message:
CID: 18. RESOURCE_LEAK in error legs.

Additionally, we ought to treat the mechanism as failed if we couldn't
parse the data we read.

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/heartbeat/findif.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -3 -r1.54 -r1.55
--- findif.c    9 Mar 2006 04:52:29 -0000       1.54
+++ findif.c    7 Apr 2006 13:00:15 -0000       1.55
@@ -1,4 +1,4 @@
-/* $Id: findif.c,v 1.54 2006/03/09 04:52:29 xunsun Exp $ */
+/* $Id: findif.c,v 1.55 2006/04/07 13:00:15 lars Exp $ */
 /*
  * findif.c:   Finds an interface which can route a given address
  *
@@ -213,6 +213,7 @@
        unsigned long   dest;
        long            metric = LONG_MAX;
        long            best_metric = LONG_MAX;
+       int             rc;
        
        char    buf[2048];
        char    interface[MAXSTR];
@@ -222,7 +223,7 @@
                snprintf(errmsg, errmsglen
                ,       "Cannot open %s for reading"
                ,       PROCROUTE);
-               return(-1);
+               rc = -1; goto out;
        }
 
        /* Skip first (header) line */
@@ -230,7 +231,7 @@
                snprintf(errmsg, errmsglen
                ,       "Cannot skip first line from %s"
                ,       PROCROUTE);
-               return(-1);
+               rc = -1; goto out;
        }
        while (fgets(buf, sizeof(buf), routefd) != NULL) {
                if (sscanf(buf, "%[^\t]\t%lx%lx%lx%lx%lx%lx%lx"
@@ -239,7 +240,7 @@
                != 8) {
                        snprintf(errmsg, errmsglen, "Bad line in %s: %s"
                        ,       PROCROUTE, buf);
-                       return(1);
+                       rc = -1; goto out;
                }
                if ( (in->s_addr&mask) == (in_addr_t)(dest&mask)
                &&      metric < best_metric) {
@@ -248,14 +249,17 @@
                        strncpy(best_if, interface, best_iflen);
                }
        }
-       fclose(routefd);
 
+out:
+       if (routefd)
+               fclose(routefd);
+       
        if (best_metric == LONG_MAX) {
                snprintf(errmsg, errmsglen, "No route to %s\n", address);
-               return(1); 
+               rc = 1; 
        }
 
-       return(0);
+       return(rc);
 }
 
 static int
@@ -894,6 +898,12 @@
 
 /* 
  * $Log: findif.c,v $
+ * Revision 1.55  2006/04/07 13:00:15  lars
+ * CID: 18. RESOURCE_LEAK in error legs.
+ *
+ * Additionally, we ought to treat the mechanism as failed if we couldn't
+ * parse the data we read.
+ *
  * Revision 1.54  2006/03/09 04:52:29  xunsun
  * removed the extra blanks which would cause problems when parsed by OCF 
IPaddr RA
  *




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

Message: 3
Date: Fri,  7 Apr 2006 07:03:47 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: heartbeat by lars from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : lars
Host    : 
Project : linux-ha
Module  : heartbeat

Dir     : linux-ha/heartbeat


Modified Files:
        findif.c 


Log Message:
CID 19: RESOURCE_LEAK in error leg.

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/heartbeat/findif.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -3 -r1.55 -r1.56
--- findif.c    7 Apr 2006 13:00:15 -0000       1.55
+++ findif.c    7 Apr 2006 13:03:47 -0000       1.56
@@ -1,4 +1,4 @@
-/* $Id: findif.c,v 1.55 2006/04/07 13:00:15 lars Exp $ */
+/* $Id: findif.c,v 1.56 2006/04/07 13:03:47 lars Exp $ */
 /*
  * findif.c:   Finds an interface which can route a given address
  *
@@ -251,9 +251,10 @@
        }
 
 out:
-       if (routefd)
+       if (routefd) {
                fclose(routefd);
-       
+       }
+
        if (best_metric == LONG_MAX) {
                snprintf(errmsg, errmsglen, "No route to %s\n", address);
                rc = 1; 
@@ -548,24 +549,25 @@
 {
        char buf[512];
        FILE * fd;
-
+       char *rc = NULL;
+       
        if (!output) {
                fprintf(stderr, "output buf is a null pointer.\n");
-               return NULL;
+               goto out;
        }
 
        fd = fopen(PATH_PROC_NET_DEV, "r");
        if (!fd) {
                fprintf(stderr, "Warning: cannot open %s (%s).\n",
                        PATH_PROC_NET_DEV, strerror(errno)); 
-               return NULL;
+               goto out;
        }
 
        /* Skip the first two lines */
        if (!fgets(buf, sizeof(buf), fd) || !fgets(buf, sizeof(buf), fd)) {
                fprintf(stderr, "Warning: cannot read header from %s.\n",
                        PATH_PROC_NET_DEV);
-               return NULL;
+               goto out;
        }
 
        while (fgets(buf, sizeof(buf), fd)) {
@@ -576,13 +578,16 @@
                }
                if (is_loopback_interface(name)) {
                        strncpy(output, name, IFNAMSIZ);
-                       fclose(fd);
-                       return output;
+                       rc = output;
+                       goto out;
                }
        }
 
-       fclose(fd);
-       return NULL;
+out:
+       if (fd) {
+               fclose(fd);
+       }
+       return rc;
 }
 
 int
@@ -898,6 +903,9 @@
 
 /* 
  * $Log: findif.c,v $
+ * Revision 1.56  2006/04/07 13:03:47  lars
+ * CID 19: RESOURCE_LEAK in error leg.
+ *
  * Revision 1.55  2006/04/07 13:00:15  lars
  * CID: 18. RESOURCE_LEAK in error legs.
  *




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

Message: 4
Date: Fri,  7 Apr 2006 07:07:13 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: lib by lars from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : lars
Host    : 
Project : linux-ha
Module  : lib

Dir     : linux-ha/lib/clplumbing


Modified Files:
        cl_msg_types.c 


Log Message:
CID 29: REVERSE_INULL, we dereferenced element before the NULL check.
(Probably happened when the declarations were reordered to the beginning
of the block.)

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lib/clplumbing/cl_msg_types.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -3 -r1.35 -r1.36
--- cl_msg_types.c      18 Dec 2005 07:57:52 -0000      1.35
+++ cl_msg_types.c      7 Apr 2006 13:07:13 -0000       1.36
@@ -211,15 +211,16 @@
        char* p =  buf;
 
        for (i = 0; i < g_list_length(list) ; i++){
-               
                char * element = g_list_nth_data(list, i);
-               int element_len = strlen(element);
+               int element_len;
+
                if (element == NULL){
                        cl_log(LOG_ERR, "string_list_pack: "
                               "%luth element of the string list is NULL"
                                , (unsigned long)i);
                        return 0;
                }
+               element_len = strlen(element);
                if (p + 2 + element_len + intlen(element_len)> maxp){
                        cl_log(LOG_ERR, "%s: memory out of boundary",
                               __FUNCTION__);




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

_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs


End of Linux-ha-cvs Digest, Vol 29, Issue 33
********************************************

Reply via email to