From: Reid Spencer Date: Mon, 9 Apr 2007 17:20:18 +0000 (+0000) Subject: Remove a memory leak, until ParamAttrsList is uniqued. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3aad26e4da495178885ed0841996fb1dd4a17de5;p=oota-llvm.git Remove a memory leak, until ParamAttrsList is uniqued. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35823 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp index 0e74f2e4f89..ace800dfb2b 100644 --- a/lib/VMCore/Type.cpp +++ b/lib/VMCore/Type.cpp @@ -1098,7 +1098,11 @@ FunctionType *FunctionType::get(const Type *ReturnType, FunctionValType VT(ReturnType, Params, isVarArg, Attrs); FunctionType *MT = FunctionTypes->get(VT); - if (MT) return MT; + if (MT) { + delete Attrs; // not needed any more + return MT; + } + MT = (FunctionType*) new char[sizeof(FunctionType) + sizeof(PATypeHandle)*(Params.size()+1)];