Author: delphij
Date: Fri Mar  5 00:31:03 2010
New Revision: 204743
URL: http://svn.freebsd.org/changeset/base/204743

Log:
  MFC r203459:
  
  Plug two memory leaks in error case.

Modified:
  stable/8/sbin/dump/itime.c
  stable/8/sbin/dump/main.c
Directory Properties:
  stable/8/sbin/dump/   (props changed)

Modified: stable/8/sbin/dump/itime.c
==============================================================================
--- stable/8/sbin/dump/itime.c  Thu Mar  4 23:30:57 2010        (r204742)
+++ stable/8/sbin/dump/itime.c  Fri Mar  5 00:31:03 2010        (r204743)
@@ -106,8 +106,10 @@ readdumptimes(FILE *df)
 
        for (;;) {
                dtwalk = (struct dumptime *)calloc(1, sizeof (struct dumptime));
-               if (getrecord(df, &(dtwalk->dt_value)) < 0)
+               if (getrecord(df, &(dtwalk->dt_value)) < 0) {
+                       free(dtwalk);
                        break;
+               }
                nddates++;
                SLIST_INSERT_HEAD(&dthead, dtwalk, dt_list);
        }

Modified: stable/8/sbin/dump/main.c
==============================================================================
--- stable/8/sbin/dump/main.c   Thu Mar  4 23:30:57 2010        (r204742)
+++ stable/8/sbin/dump/main.c   Fri Mar  5 00:31:03 2010        (r204743)
@@ -767,7 +767,8 @@ obsolete(int *argcp, char **argvp[])
        if (flags) {
                *p = '\0';
                *nargv++ = flagsp;
-       }
+       } else
+               free(flagsp);
 
        /* Copy remaining arguments. */
        while ((*nargv++ = *argv++));
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to