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