<div dir="ltr">Any chance of using unique_ptr, or at least a scoped cleanup device, here?</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 11, 2016 at 1:54 PM, Hans Wennborg via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: hans<br>
Date: Mon Apr 11 15:53:59 2016<br>
New Revision: 265994<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=265994&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=265994&view=rev</a><br>
Log:<br>
libclang: fix two memory leaks (PR26292)<br>
<br>
Modified:<br>
    cfe/trunk/tools/libclang/CIndex.cpp<br>
<br>
Modified: cfe/trunk/tools/libclang/CIndex.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=265994&r1=265993&r2=265994&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=265994&r1=265993&r2=265994&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/tools/libclang/CIndex.cpp (original)<br>
+++ cfe/trunk/tools/libclang/CIndex.cpp Mon Apr 11 15:53:59 2016<br>
@@ -3571,12 +3571,13 @@ static const ExprEvalResult* evaluateExp<br>
       rettype = callExpr->getCallReturnType(ctx);<br>
<br>
       if (rettype->isVectorType() || callExpr->getNumArgs() > 1) {<br>
+        clang_EvalResult_dispose((CXEvalResult *)result);<br>
         return nullptr;<br>
       }<br>
       if (rettype->isIntegralType(ctx) || rettype->isRealFloatingType()) {<br>
         if(callExpr->getNumArgs() == 1 &&<br>
-              !callExpr->getArg(0)->getType()->isIntegralType(ctx)){<br>
-<br>
+              !callExpr->getArg(0)->getType()->isIntegralType(ctx)) {<br>
+          clang_EvalResult_dispose((CXEvalResult *)result);<br>
           return nullptr;<br>
         }<br>
       } else if(rettype.getAsString() == "CFStringRef") {<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>