commit-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Inetutils branch, master, updated. inetutils-1_8-88-g46dedcf


From: Mats Erik Andersson
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_8-88-g46dedcf
Date: Fri, 06 May 2011 17:26:29 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  46dedcf228def17144eff9a063fb6b249146577e (commit)
      from  6406851b3fb6cf4d396c49c7f2143369d7bd4a0e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=46dedcf228def17144eff9a063fb6b249146577e


commit 46dedcf228def17144eff9a063fb6b249146577e
Author: Mats Erik Andersson <address@hidden>
Date:   Fri May 6 16:37:42 2011 +0200

    syslogd: Fix memory leaks related to action fields.

diff --git a/ChangeLog b/ChangeLog
index 31a9a84..f4a39a6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-05-06  Mats Erik Andersson <address@hidden>
+
+       * src/syslogd.c (fprintlog): Deallocate pointers F_HNAME or F_FNAME
+       when F_TYPE is invalidated as F_UNUSED.
+       (cfline): Likewise.
+       (init): Deallocate F_FNAME, F_HNAME, F_UNAMES, and F_PREVHOST before
+       reclaiming the pointer F.
+
 2011-04-17  Mats Erik Andersson <address@hidden>
 
        * ftp/ftp_var.h (usefamily): New variable.
diff --git a/src/syslogd.c b/src/syslogd.c
index 10a13a0..5927f9f 100644
--- a/src/syslogd.c
+++ b/src/syslogd.c
@@ -1211,7 +1211,11 @@ fprintlog (struct filed *f, const char *from, int flags, 
const char *msg)
              dbg_printf ("Failure: %s\n", hstrerror (h_errno));
              dbg_printf ("Retries: %d\n", f->f_prevcount);
              if (--f->f_prevcount < 0)
-               f->f_type = F_UNUSED;
+               {
+                 f->f_type = F_UNUSED;
+                 free (f->f_un.f_forw.f_hname);
+                 f->f_un.f_forw.f_hname = NULL;
+               }
            }
          else
            {
@@ -1301,6 +1305,8 @@ fprintlog (struct filed *f, const char *from, int flags, 
const char *msg)
                {
                  f->f_type = F_UNUSED;
                  logerror (f->f_un.f_fname);
+                 free (f->f_un.f_fname);
+                 f->f_un.f_fname = NULL;
                }
              else
                goto again;
@@ -1310,6 +1316,8 @@ fprintlog (struct filed *f, const char *from, int flags, 
const char *msg)
              f->f_type = F_UNUSED;
              errno = e;
              logerror (f->f_un.f_fname);
+             free (f->f_un.f_fname);
+             f->f_un.f_fname = NULL;
            }
        }
       else if ((flags & SYNC_FILE) && !(f->f_flags & OMIT_SYNC))
@@ -1571,6 +1579,8 @@ init (int signo ARG_UNUSED)
   Initialized = 0;
   for (f = Files; f != NULL; f = next)
     {
+      int j;
+
       /* Flush any pending output.  */
       if (f->f_prevcount)
        fprintlog (f, LocalHostName, 0, (char *) NULL);
@@ -1581,9 +1591,22 @@ init (int signo ARG_UNUSED)
        case F_TTY:
        case F_CONSOLE:
        case F_PIPE:
+         free (f->f_un.f_fname);
          close (f->f_file);
          break;
+       case F_FORW:
+       case F_FORW_SUSP:
+       case F_FORW_UNKN:
+         free (f->f_un.f_forw.f_hname);
+         break;
+       case F_USERS:
+         for (j = 0; j < f->f_un.f_user.f_nusers; ++j)
+           free (f->f_un.f_user.f_unames[j]);
+         free (f->f_un.f_user.f_unames);
+         break;
        }
+      if (f->f_prevhost)
+       free (f->f_prevhost);
       next = f->f_next;
       free (f);
     }
@@ -1915,6 +1938,8 @@ cfline (const char *line, struct filed *f)
        {
          f->f_type = F_UNUSED;
          logerror (p);
+         free (f->f_un.f_fname);
+         f->f_un.f_fname = NULL;
          break;
        }
       if (strcmp (p, ctty) == 0)
@@ -1931,6 +1956,8 @@ cfline (const char *line, struct filed *f)
        {
          f->f_type = F_UNUSED;
          logerror (p);
+         free (f->f_un.f_fname);
+         f->f_un.f_fname = NULL;
          break;
        }
       if (strcmp (p, ctty) == 0)

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

Summary of changes:
 ChangeLog     |    8 ++++++++
 src/syslogd.c |   29 ++++++++++++++++++++++++++++-
 2 files changed, 36 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]