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