diff --git a/sbin/dump/itime.c b/sbin/dump/itime.c index 1f1a3e58711..4cac87b41a1 100644 --- a/sbin/dump/itime.c +++ b/sbin/dump/itime.c @@ -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); } diff --git a/sbin/dump/main.c b/sbin/dump/main.c index 7a99522783f..e344887de14 100644 --- a/sbin/dump/main.c +++ b/sbin/dump/main.c @@ -767,7 +767,8 @@ obsolete(int *argcp, char **argvp[]) if (flags) { *p = '\0'; *nargv++ = flagsp; - } + } else + free(flagsp); /* Copy remaining arguments. */ while ((*nargv++ = *argv++));