This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH][committed] Fix leak in final.c


Patch says it all.
Committed as obvious.

Thanks,
Andrew Pinski



ChangeLog:
        * final.c (shorten_branches): Free uid_shuid before
        reallocating it.

Patch:

Index: final.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/final.c,v
retrieving revision 1.312
diff -u -p -r1.312 final.c
--- final.c	13 May 2004 06:39:39 -0000	1.312
+++ final.c	13 May 2004 21:50:26 -0000
@@ -767,6 +767,9 @@ shorten_branches (rtx first ATTRIBUTE_UN
   /* Compute maximum UID and allocate label_align / uid_shuid.  */
   max_uid = get_max_uid ();

+  /* Free uid_shuid before reallocating it.   */
+  free (uid_shuid);
+
   uid_shuid = xmalloc (max_uid * sizeof *uid_shuid);

if (max_labelno != max_label_num ())


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]