have dirread pass the allocation buck on to caller Notes: Sat Jan 3 19:39:02 EST 2009 jmk In general, a patch should 1) compile without error or warning; 2) if it's a library routine then the APE source should be checked to see if it applies there, and a 'mk all' should be done in /sys/src to ensure all uses are correct. Reference: /n/sources/patch/sorry/dirreadmt Date: Fri Jan 2 04:16:19 CET 2009 Signed-off-by: quanstro@quanstro.net Reviewed-by: geoff --- /sys/src/libc/9sys/dirread.c Fri Jan 2 04:16:15 2009 +++ /sys/src/libc/9sys/dirread.c Fri Jan 2 04:16:14 2009 @@ -65,6 +65,8 @@ if(ts >= 0) ts = dirpackage(buf, ts, d); free(buf); + if(*d != nil) + setmalloctag(*t, getcallerpc(&fd)); return ts; } @@ -91,6 +93,8 @@ if(ts >= 0) ts = dirpackage(buf, ts, d); free(buf); + if(*d != nil) + setmalloctag(*t, getcallerpc(&fd)); if(ts == 0 && n < 0) return -1; return ts;