svn commit: r299149 - stable/9/sbin/restore

Pedro F. Giffuni pfg at FreeBSD.org
Fri May 6 01:38:14 UTC 2016


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':
 		/*


More information about the svn-src-stable-9 mailing list