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 03d7ae3a74
commit 8684923644
1 changed files with 5 additions and 1 deletions

View File

@ -1098,7 +1098,11 @@ FunctionType *FunctionType::get(const Type *ReturnType,
FunctionValType VT(ReturnType, Params, isVarArg, Attrs); FunctionValType VT(ReturnType, Params, isVarArg, Attrs);
FunctionType *MT = FunctionTypes->get(VT); 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) + MT = (FunctionType*) new char[sizeof(FunctionType) +
sizeof(PATypeHandle)*(Params.size()+1)]; sizeof(PATypeHandle)*(Params.size()+1)];