svn commit: r231531 - stable/8/bin/sh

Jilles Tjoelker jilles at FreeBSD.org
Sat Feb 11 20:37:09 UTC 2012


Author: jilles
Date: Sat Feb 11 20:37:08 2012
New Revision: 231531
URL: http://svn.freebsd.org/changeset/base/231531

Log:
  MFC r231001: sh: Fix swapped INTON/INTOFF.
  
  A possible consequence of this bug was a memory leak if SIGINT arrived
  during a 'set' command (listing variables).

Modified:
  stable/8/bin/sh/var.c
Directory Properties:
  stable/8/bin/sh/   (props changed)

Modified: stable/8/bin/sh/var.c
==============================================================================
--- stable/8/bin/sh/var.c	Sat Feb 11 20:28:42 2012	(r231530)
+++ stable/8/bin/sh/var.c	Sat Feb 11 20:37:08 2012	(r231531)
@@ -547,7 +547,7 @@ showvarscmd(int argc __unused, char **ar
 		}
 	}
 
-	INTON;
+	INTOFF;
 	vars = ckmalloc(n * sizeof(*vars));
 	i = 0;
 	for (vpp = vartab; vpp < vartab + VTABSIZE; vpp++) {
@@ -566,7 +566,7 @@ showvarscmd(int argc __unused, char **ar
 		out1c('\n');
 	}
 	ckfree(vars);
-	INTOFF;
+	INTON;
 
 	return 0;
 }


More information about the svn-src-stable mailing list