Author: pfg
Date: Fri May 6 01:38:12 2016
New Revision: 299149
URL: https://svnweb.freebsd.org/changeset/base/299149
Log:
MFC r298868, r298874:
restore: fix memory and resource handle leaks.
CID: 272297, 1007784
Modified:
stable/9/sbin/restore/main.c
stable/9/sbin/restore/symtab.c
Directory Properties:
stable/9/sbin/restore/ (props changed)
Modified: stable/9/sbin/restore/main.c
==============================================================================
--- stable/9/sbin/restore/main.c Fri May 6 01:37:06 2016
(r299148)
+++ stable/9/sbin/restore/main.c Fri May 6 01:38:12 2016
(r299149)
@@ -366,7 +366,8 @@ obsolete(int *argcp, char **argvp[])
if (flags) {
*p = '\0';
*nargv++ = flagsp;
- }
+ } else
+ free(flagsp);
/* Copy remaining arguments. */
while ((*nargv++ = *argv++));
Modified: stable/9/sbin/restore/symtab.c
==============================================================================
--- stable/9/sbin/restore/symtab.c Fri May 6 01:37:06 2016
(r299148)
+++ stable/9/sbin/restore/symtab.c Fri May 6 01:38:12 2016
(r299149)
@@ -559,6 +559,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':
/*
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-9
To unsubscribe, send any mail to "[email protected]"