Fix memory leaks (coverity issues 1365586 & 1365591)

Reviewers: hfinkel

Subscribers: george.burgess.iv, malcolm.parsons, boris.ulasevich, llvm-commits

Differential Revision: https://reviews.llvm.org/D26347

llvm-svn: 286223
This commit is contained in:
Sylvestre Ledru 2016-11-08 10:00:45 +00:00
parent 7783ea6a61
commit 3ce346d4ca
1 changed files with 6 additions and 2 deletions

View File

@ -1686,8 +1686,10 @@ IEEEFloat::opStatus IEEEFloat::remainder(const IEEEFloat &rhs) {
bool ignored;
fs = V.convertToInteger(x, parts * integerPartWidth, true,
rmNearestTiesToEven, &ignored);
if (fs==opInvalidOp)
if (fs==opInvalidOp) {
delete[] x;
return fs;
}
fs = V.convertFromZeroExtendedInteger(x, parts * integerPartWidth, true,
rmNearestTiesToEven);
@ -1724,8 +1726,10 @@ IEEEFloat::opStatus IEEEFloat::mod(const IEEEFloat &rhs) {
bool ignored;
fs = V.convertToInteger(x, parts * integerPartWidth, true,
rmTowardZero, &ignored);
if (fs==opInvalidOp)
if (fs==opInvalidOp) {
delete[] x;
return fs;
}
fs = V.convertFromZeroExtendedInteger(x, parts * integerPartWidth, true,
rmNearestTiesToEven);