Blame SOURCES/ksh-20120801-assoc-unset-leak.patch
|
|
bd3d17 |
diff -up ksh-20120801/src/cmd/ksh93/sh/name.c.orig ksh-20120801/src/cmd/ksh93/sh/name.c
|
|
|
bd3d17 |
--- ksh-20120801/src/cmd/ksh93/sh/name.c.orig 2015-02-10 17:15:37.180783550 -0200
|
|
|
bd3d17 |
+++ ksh-20120801/src/cmd/ksh93/sh/name.c 2015-02-10 18:25:51.726228437 -0200
|
|
|
bd3d17 |
@@ -1298,7 +1298,16 @@ void nv_delete(Namval_t* np, Dt_t *root,
|
|
|
bd3d17 |
if(dtdelete(root,np))
|
|
|
bd3d17 |
{
|
|
|
bd3d17 |
if(!(flags&NV_NOFREE) && ((flags&NV_FUNCTION) || !nv_subsaved(np,flags&NV_TABLE)))
|
|
|
bd3d17 |
+ {
|
|
|
bd3d17 |
+ Namarr_t *ap;
|
|
|
bd3d17 |
+ if(nv_isarray(np) && np->nvfun && (ap=nv_arrayptr(np)) && array_assoc(ap)) {
|
|
|
bd3d17 |
+ while(nv_associative(np,0,NV_ANEXT))
|
|
|
bd3d17 |
+ nv_associative(np, 0, NV_ADELETE);
|
|
|
bd3d17 |
+ nv_associative(np, 0, NV_AFREE);
|
|
|
bd3d17 |
+ free((void*)np->nvfun);
|
|
|
bd3d17 |
+ }
|
|
|
bd3d17 |
free((void*)np);
|
|
|
bd3d17 |
+ }
|
|
|
bd3d17 |
}
|
|
|
bd3d17 |
#if 0
|
|
|
bd3d17 |
else
|