diff options
| author | Reid Spencer <rspencer@reidspencer.com> | 2007-04-09 17:20:18 +0000 |
|---|---|---|
| committer | Reid Spencer <rspencer@reidspencer.com> | 2007-04-09 17:20:18 +0000 |
| commit | 868492364403ff78f7c278cafe2dcf2bd24b9aa9 (patch) | |
| tree | ca1173394e832748dd3c7fc1d826e31b14b40db6 /llvm/lib/VMCore | |
| parent | 03d7ae3a74a76cf032162873365904bc5808fba0 (diff) | |
| download | bcm5719-llvm-868492364403ff78f7c278cafe2dcf2bd24b9aa9.tar.gz bcm5719-llvm-868492364403ff78f7c278cafe2dcf2bd24b9aa9.zip | |
Remove a memory leak, until ParamAttrsList is uniqued.
llvm-svn: 35823
Diffstat (limited to 'llvm/lib/VMCore')
| -rw-r--r-- | llvm/lib/VMCore/Type.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/VMCore/Type.cpp b/llvm/lib/VMCore/Type.cpp index 0e74f2e4f89..ace800dfb2b 100644 --- a/llvm/lib/VMCore/Type.cpp +++ b/llvm/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)]; |

