svn commit: r231001 - head/bin/sh

Jilles Tjoelker jilles at FreeBSD.org
Sat Feb 4 23:29:08 UTC 2012


Author: jilles
Date: Sat Feb  4 23:29:07 2012
New Revision: 231001
URL: http://svn.freebsd.org/changeset/base/231001

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

Modified:
  head/bin/sh/var.c

Modified: head/bin/sh/var.c
==============================================================================
--- head/bin/sh/var.c	Sat Feb  4 23:27:16 2012	(r231000)
+++ head/bin/sh/var.c	Sat Feb  4 23:29:07 2012	(r231001)
@@ -603,7 +603,7 @@ showvarscmd(int argc __unused, char **ar
 		}
 	}
 
-	INTON;
+	INTOFF;
 	vars = ckmalloc(n * sizeof(*vars));
 	i = 0;
 	for (vpp = vartab; vpp < vartab + VTABSIZE; vpp++) {
@@ -628,7 +628,7 @@ showvarscmd(int argc __unused, char **ar
 		out1c('\n');
 	}
 	ckfree(vars);
-	INTOFF;
+	INTON;
 
 	return 0;
 }


More information about the svn-src-all mailing list