Blame SOURCES/ksh-20120801-subshell-leak.patch

2642b8
diff --git a/src/cmd/ksh93/sh/path.c b/src/cmd/ksh93/sh/path.c
2642b8
index d723987..9965bf5 100644
2642b8
--- a/src/cmd/ksh93/sh/path.c
2642b8
+++ b/src/cmd/ksh93/sh/path.c
2642b8
@@ -1791,8 +1791,12 @@ void path_alias(register Namval_t *np,register Pathcomp_t *pp)
2642b8
 	{
2642b8
 		struct stat statb;
2642b8
 		char *sp;
2642b8
+		Pathcomp_t *old = 0;
2642b8
 		nv_offattr(np,NV_NOPRINT);
2642b8
 		nv_stack(np,&talias_init);
2642b8
+		old = (Pathcomp_t*)np->nvalue.cp;
2642b8
+		if (old && (--old->refcount <= 0))
2642b8
+			free((void*)old);
2642b8
 		np->nvalue.cp = (char*)pp;
2642b8
 		pp->refcount++;
2642b8
 		nv_setattr(np,NV_TAGGED|NV_NOFREE);
2642b8
-- 
2642b8
2.9.3
2642b8