Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 May 2016 01:38:12 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r299149 - stable/9/sbin/restore
Message-ID:  <201605060138.u461cC2N050898@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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':
 		/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605060138.u461cC2N050898>