r316403 - [Analyzer] Fix for the memory leak: fix typo in if-statement.
David Blaikie via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 30 08:33:45 PDT 2017
I realize this was changed in a follow-up commit anyway, but for future
reference: There's no need (& best to avoid - simpler to read, avoids bugs
like this, etc) to conditionalize delete like this. Delete is a no-op on
null pointers anyway, so this dtor should just contain an unconditional
"delete BdyFrm;"
On Mon, Oct 23, 2017 at 6:09 PM George Karpenkov via cfe-commits <
cfe-commits at lists.llvm.org> wrote:
> Author: george.karpenkov
> Date: Mon Oct 23 18:09:43 2017
> New Revision: 316403
>
> URL: http://llvm.org/viewvc/llvm-project?rev=316403&view=rev
> Log:
> [Analyzer] Fix for the memory leak: fix typo in if-statement.
>
> Modified:
> cfe/trunk/lib/Analysis/AnalysisDeclContext.cpp
>
> Modified: cfe/trunk/lib/Analysis/AnalysisDeclContext.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/AnalysisDeclContext.cpp?rev=316403&r1=316402&r2=316403&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/Analysis/AnalysisDeclContext.cpp (original)
> +++ cfe/trunk/lib/Analysis/AnalysisDeclContext.cpp Mon Oct 23 18:09:43 2017
> @@ -604,7 +604,7 @@ AnalysisDeclContext::~AnalysisDeclContex
> }
>
> AnalysisDeclContextManager::~AnalysisDeclContextManager() {
> - if (!BdyFrm)
> + if (BdyFrm)
> delete BdyFrm;
> }
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171030/d9d6a030/attachment.html>
More information about the cfe-commits
mailing list