A memory leak patch for cplus-dem.c

H.J. Lu hjl@lucon.org
Wed Jan 13 10:35:00 GMT 1999


Without it, work->previous_argument may be freed more than once.


-- 
H.J. Lu (hjl@gnu.org)
----
Wed Jan 13 07:26:44 1999  H.J. Lu  (hjl@gnu.org)

	* cplus-dem.c (mop_up): Set work->previous_argument to NULL
	after freeing it.

Index: cplus-dem.c
===================================================================
RCS file: /home/work/cvs/gnu/egcs/libiberty/cplus-dem.c,v
retrieving revision 1.1.1.24
diff -u -p -r1.1.1.24 cplus-dem.c
--- cplus-dem.c	1999/01/09 18:30:16	1.1.1.24
+++ cplus-dem.c	1999/01/13 18:27:12
@@ -875,6 +875,7 @@ mop_up (work, declp, success)
     {
       string_delete (work->previous_argument);
       free ((char*) work->previous_argument);
+      work->previous_argument = NULL;
     }
 
   /* If demangling was successful, ensure that the demangled string is null



More information about the Gcc-patches mailing list