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