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] Memory leak in parallel/unique_copy


Hi,

In parallel/unique_copy.h __counter is never deleted.

I'm also trying to follow from other posts how to submit a patch but
is well possible I missed some of the conventions. Many apologies if
that's the case.

libstdc++-v3/

* include/parallel/unique_copy.h: prevent memory leak of __counter

Index: libstdc++-v3/include/parallel/unique_copy.h
===================================================================
--- libstdc++-v3/include/parallel/unique_copy.h (revision 212239)
+++ libstdc++-v3/include/parallel/unique_copy.h (working copy)
@@ -171,6 +171,7 @@
       for (_ThreadIndex __t = 0; __t < __num_threads + 1; __t++)
  __end_output += __counter[__t];

+      delete[] __counter;
       delete[] __borders;

       return __result + __end_output;


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