diff options
author | delphij <delphij@FreeBSD.org> | 2010-03-05 00:31:03 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2010-03-05 00:31:03 +0000 |
commit | a8f46feadae1104d725517e9a0544a489ba89da3 (patch) | |
tree | 1d8f44c4d8e3577bb801baa9bba0f75063671021 | |
parent | 148ebaa14a79953c626409314ab325aed51c0795 (diff) | |
download | FreeBSD-src-a8f46feadae1104d725517e9a0544a489ba89da3.zip FreeBSD-src-a8f46feadae1104d725517e9a0544a489ba89da3.tar.gz |
MFC r203459:
Plug two memory leaks in error case.
-rw-r--r-- | sbin/dump/itime.c | 4 | ||||
-rw-r--r-- | sbin/dump/main.c | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/sbin/dump/itime.c b/sbin/dump/itime.c index 1f1a3e5..4cac87b 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 7a99522..e344887 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++)); |