[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (another) problem with mntlib41 tfork() function



This patch for MiNTlib PL41 fixes the memory leak. It just moves the
calls to Mfree to the right place.

--- orig/thread.c	Fri Sep 17 18:10:46 1993
+++ thread.c	Tue Dec  7 01:10:58 1993
@@ -95,8 +95,6 @@
 
 		now = _clock();
 		pid = Pexec(4, 0L, b, 0L);
-		(void)Mfree(b->p_env);	/* free the memory */
-		(void)Mfree(b);
 
 		_base = savbase;
 	/* restore signal stuff */
@@ -115,5 +113,7 @@
 			_childtime += __waittime;
 		}
 	}
+	(void)Mfree(b->p_env);	/* free the memory */
+	(void)Mfree(b);
 	return pid;
 }