96f265
diff -up ksh-20120801/src/cmd/ksh93/sh/init.c.covsfix ksh-20120801/src/cmd/ksh93/sh/init.c
96f265
--- ksh-20120801/src/cmd/ksh93/sh/init.c.covsfix	2013-07-22 17:41:34.674054068 +0200
96f265
+++ ksh-20120801/src/cmd/ksh93/sh/init.c	2013-07-22 17:42:50.761361921 +0200
96f265
@@ -1237,9 +1237,11 @@ static void put_mode(Namval_t* np, const
96f265
 				mode = *(double*)val;
96f265
 		}
96f265
 		else
96f265
+		{
96f265
 			mode = strperm(val, &last,0);
96f265
-		if(*last)
96f265
-			errormsg(SH_DICT,ERROR_exit(1),"%s: invalid mode string",val);
96f265
+			if(*last)
96f265
+				errormsg(SH_DICT,ERROR_exit(1),"%s: invalid mode string",val);
96f265
+		}
96f265
 		nv_putv(np,(char*)&mode,NV_INTEGER,nfp);
96f265
 	}
96f265
 	else
96f265
diff -up ksh-20120801/src/cmd/ksh93/sh/io.c.covsfix ksh-20120801/src/cmd/ksh93/sh/io.c
96f265
--- ksh-20120801/src/cmd/ksh93/sh/io.c.covsfix	2013-07-22 17:06:30.282927080 +0200
96f265
+++ ksh-20120801/src/cmd/ksh93/sh/io.c	2013-07-22 17:08:49.645721280 +0200
96f265
@@ -954,6 +954,7 @@ int	sh_pipe(register int pv[])
96f265
 	socklen_t		slen;
96f265
 	if ((pv[out] = socket (AF_INET, SOCK_STREAM, 0)) < 0)
96f265
 		errormsg(SH_DICT,ERROR_system(1),e_pipe);
96f265
+	memset(&sin.sin_zero, 0, sizeof(sin.sin_zero));
96f265
 	do
96f265
 	{
96f265
 		sin.sin_family = AF_INET;
96f265
diff -up ksh-20120801/src/cmd/ksh93/sh/name.c.covsfix ksh-20120801/src/cmd/ksh93/sh/name.c
96f265
--- ksh-20120801/src/cmd/ksh93/sh/name.c.covsfix	2013-07-22 17:40:31.644635604 +0200
96f265
+++ ksh-20120801/src/cmd/ksh93/sh/name.c	2013-07-22 17:41:15.828227073 +0200
96f265
@@ -3094,6 +3094,7 @@ void nv_newattr (register Namval_t *np,
96f265
 			if(!mp)
96f265
 				nv_putval (np, cp, NV_RDONLY);
96f265
 			free(cp);
96f265
+			cp = NULL;
96f265
 		}
96f265
 	}
96f265
 	while(ap && nv_nextsub(np));
96f265
diff -up ksh-20120801/src/cmd/ksh93/sh/subshell.c.covsfix ksh-20120801/src/cmd/ksh93/sh/subshell.c
96f265
--- ksh-20120801/src/cmd/ksh93/sh/subshell.c.covsfix	2013-07-22 17:46:15.607533423 +0200
96f265
+++ ksh-20120801/src/cmd/ksh93/sh/subshell.c	2013-07-22 17:48:36.739290968 +0200
96f265
@@ -205,7 +205,14 @@ void sh_subfork(void)
96f265
 		shp->comsub = 0;
96f265
 		SH_SUBSHELLNOD->nvalue.s = 0;
96f265
 		sp->subpid=0;
96f265
-		shp->st.trapcom[0] = (comsub==2?NULL:trap);
96f265
+		if (comsub==2)
96f265
+		{
96f265
+			shp->st.trapcom[0] = NULL;
96f265
+			if(trap)
96f265
+				free((void*)trap);
96f265
+		}
96f265
+		else
96f265
+			shp->st.trapcom[0] = (comsub==2?NULL:trap);
96f265
 		shp->savesig = 0;
96f265
 	}
96f265
 }