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
This commit is contained in:
Reid Spencer 2007-04-09 17:20:18 +00:00
parent 4522c8a44c
commit 3aad26e4da

View File

@ -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)];