<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On May 3, 2014, at 6:55 , David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">(oops, sorry Chandler, accidentally replied rather than reply-all.<br>Re-adding the mailing list)<br><br>On Sat, May 3, 2014 at 1:39 AM, Chandler Carruth <<a href="mailto:chandlerc@gmail.com">chandlerc@gmail.com</a>> wrote:<br><blockquote type="cite">Author: chandlerc<br>Date: Sat May  3 03:39:35 2014<br>New Revision: 207899<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=207899&view=rev">http://llvm.org/viewvc/llvm-project?rev=207899&view=rev</a><br>Log:<br>[leaks] Don't leak the fake arguments we synthesize for LLVM option<br>parsing.<br><br>Modified:<br>   cfe/trunk/lib/FrontendTool/ExecuteCompilerInvocation.cpp<br><br>Modified: cfe/trunk/lib/FrontendTool/ExecuteCompilerInvocation.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/FrontendTool/ExecuteCompilerInvocation.cpp?rev=207899&r1=207898&r2=207899&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/FrontendTool/ExecuteCompilerInvocation.cpp?rev=207899&r1=207898&r2=207899&view=diff</a><br>==============================================================================<br>--- cfe/trunk/lib/FrontendTool/ExecuteCompilerInvocation.cpp (original)<br>+++ cfe/trunk/lib/FrontendTool/ExecuteCompilerInvocation.cpp Sat May  3 03:39:35 2014<br>@@ -212,12 +212,12 @@ bool clang::ExecuteCompilerInvocation(Co<br>  // This should happen AFTER plugins have been loaded!<br>  if (!Clang->getFrontendOpts().LLVMArgs.empty()) {<br>    unsigned NumArgs = Clang->getFrontendOpts().LLVMArgs.size();<br>-    const char **Args = new const char*[NumArgs + 2];<br>+    auto Args = llvm::make_unique<const char*[]>(NumArgs + 2);<br></blockquote><br>Would "std::vector<const char*> Args(NumArgs + 2);" be a bit simpler?<br>(yeah, I know, it has resizability which isn't needed here - and the<br>only thing it changes about usage is that it's passed as Args rather<br>than Args.get() to ParseCommandLineOptions below - but at least for me<br>having a local unique_ptr that's not polymorphic and never passed to<br>anywhere strikes me as odd)<br></div></blockquote><div><br></div><div>...or SmallVector, since there are usually very few LLVMArgs.</div><div><br></div><div>Jordan</div></div></body></html>