[m-rev.] diff: fix double free() bug

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Oct 22 00:36:23 AEST 2002


Estimated hours taken: 4
Branches: main

trace/mercury_trace.c:
	Fix a long-standing bug where we would end up freeing memory
	that had already been freed: set MR_call_table_ptrs to NULL
	after freeing it, to ensure that we don't free it again the
	next time MR_abandon_call_table_array() is called.

Workspace: /home/ceres/fjh/mercury
Index: trace/mercury_trace.c
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace.c,v
retrieving revision 1.54
diff -u -d -r1.54 mercury_trace.c
--- trace/mercury_trace.c	9 Sep 2002 07:48:24 -0000	1.54
+++ trace/mercury_trace.c	21 Oct 2002 14:31:53 -0000
@@ -1395,6 +1395,7 @@
 {
 	if (MR_call_table_ptrs != NULL) {
 		MR_free(MR_call_table_ptrs);
+		MR_call_table_ptrs = NULL;
 	}
 }
 

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list