Skip to content

Commit 6917b4a

Browse files
committed
libclang: fix two memory leaks (PR26292)
llvm-svn: 265994
1 parent 4d5535a commit 6917b4a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

clang/tools/libclang/CIndex.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3571,12 +3571,13 @@ static const ExprEvalResult* evaluateExpr(Expr *expr, CXCursor C) {
35713571
rettype = callExpr->getCallReturnType(ctx);
35723572

35733573
if (rettype->isVectorType() || callExpr->getNumArgs() > 1) {
3574+
clang_EvalResult_dispose((CXEvalResult *)result);
35743575
return nullptr;
35753576
}
35763577
if (rettype->isIntegralType(ctx) || rettype->isRealFloatingType()) {
35773578
if(callExpr->getNumArgs() == 1 &&
3578-
!callExpr->getArg(0)->getType()->isIntegralType(ctx)){
3579-
3579+
!callExpr->getArg(0)->getType()->isIntegralType(ctx)) {
3580+
clang_EvalResult_dispose((CXEvalResult *)result);
35803581
return nullptr;
35813582
}
35823583
} else if(rettype.getAsString() == "CFStringRef") {

0 commit comments

Comments
 (0)