r208481 - Don't leak default arg tokens on invalid destructors or conversion functions.

Nico Weber thakis at chromium.org
Sat May 10 17:36:14 PDT 2014


>
> >> >      void freeParams() {
> >> > +      if (Params) {
> >> > +        delete Params->DefaultArgTokens;
> >> > +        Params->DefaultArgTokens = nullptr;
> >>
> >> Doesn't Params point to an array? Looks like this will still leak the
> second and subsequent default arguments.
> >
> > I believe it points to a CachedTokens, which is a typedef for
> a SmallVector<Token, 4> – so I think it might be correct as-is?
>
> You're only deleting the tokens for the first parameter
>
You're right, of course. How does r208484 look?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140510/9dcef4d7/attachment.html>


More information about the cfe-commits mailing list