diff options
author | pfg <pfg@FreeBSD.org> | 2016-05-06 01:37:06 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2016-05-06 01:37:06 +0000 |
commit | 399bde7ffd971f7602a44774c88871a7414c157b (patch) | |
tree | 2a6d893563fc84ad5f655417faf590bc30723c14 /sbin/restore | |
parent | fdef3ab0211b87d886c8a87fe46be53c0642ee0c (diff) | |
download | FreeBSD-src-399bde7ffd971f7602a44774c88871a7414c157b.zip FreeBSD-src-399bde7ffd971f7602a44774c88871a7414c157b.tar.gz |
MFC r298868, r298874:
restore: fix memory and resource handle leaks.
CID: 272297, 1007784
Diffstat (limited to 'sbin/restore')
-rw-r--r-- | sbin/restore/main.c | 3 | ||||
-rw-r--r-- | sbin/restore/symtab.c | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/sbin/restore/main.c b/sbin/restore/main.c index 91f4a83..d74e59e 100644 --- a/sbin/restore/main.c +++ b/sbin/restore/main.c @@ -366,7 +366,8 @@ obsolete(int *argcp, char **argvp[]) if (flags) { *p = '\0'; *nargv++ = flagsp; - } + } else + free(flagsp); /* Copy remaining arguments. */ while ((*nargv++ = *argv++)); diff --git a/sbin/restore/symtab.c b/sbin/restore/symtab.c index 9d0313d..17bd642 100644 --- a/sbin/restore/symtab.c +++ b/sbin/restore/symtab.c @@ -560,6 +560,7 @@ initsymtable(char *filename) fprintf(stderr, "read: %s\n", strerror(errno)); panic("cannot read symbol table file %s\n", filename); } + (void)close(fd); switch (command) { case 'r': /* |