Remove a memory leak, until ParamAttrsList is uniqued.

llvm-svn: 35823
This commit is contained in:
Reid Spencer 2007-04-09 17:20:18 +00:00
parent e038420dc6
commit 1acc089771

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