[OpenAFS-devel] Small fix to get rid of memory leak in fstrace

Nathan Neulinger nneul@umr.edu
Fri, 22 Mar 2002 11:14:41 -0600


--azLHFNyN32YCQGCU
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

After applying this, you should be able to run fstrace for extended periods without it 
growing in size very rapidly. (On linux, it was leaking 202 bytes from catopen for every
event, since the catopen was getting rerun without closing the catalog due to the goto.)

Patch just causes the catalog to be closed prior to to goto.

-- Nathan

------------------------------------------------------------
Nathan Neulinger                       EMail:  nneul@umr.edu
University of Missouri - Rolla         Phone: (573) 341-4841
Computing Services                       Fax: (573) 341-4216

--azLHFNyN32YCQGCU
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="fstrace.diff"

Index: src/venus/fstrace.c
===================================================================
RCS file: /cvs/openafs/src/venus/fstrace.c,v
retrieving revision 1.8
diff -u -r1.8 fstrace.c
--- src/venus/fstrace.c	2001/11/01 04:02:31	1.8
+++ src/venus/fstrace.c	2002/03/22 17:12:45
@@ -1596,6 +1596,12 @@
     {
 	if (!failed) {
 	    failed = 1;
+
+#if	defined(AFS_OSF_ENV) && !defined(AFS_OSF20_ENV)
+    catclose1 (catd);
+#else
+    catclose (catd);
+#endif
 	    goto tryagain;
 	}
         sprintf ((char *) error_text, "status %08x (%s / %s)", 

--azLHFNyN32YCQGCU--