summaryrefslogtreecommitdiff
path: root/libyasm/floatnum.c
diff options
context:
space:
mode:
authorPeter Johnson <peter@tortall.net>2001-12-03 00:55:00 +0000
committerPeter Johnson <peter@tortall.net>2001-12-03 00:55:00 +0000
commit69c42d7aaaba02548c328e9952283edeb732c18a (patch)
tree8fc465b47f2a7c2dc91b748a8990f9792aea0676 /libyasm/floatnum.c
parentf36a664a4929db96815bd16b6acdfd4d19c9d38e (diff)
downloadyasm-69c42d7aaaba02548c328e9952283edeb732c18a.tar.gz
Plug memory leak in floatnum_new().
svn path=/trunk/yasm/; revision=383
Diffstat (limited to 'libyasm/floatnum.c')
-rw-r--r--libyasm/floatnum.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libyasm/floatnum.c b/libyasm/floatnum.c
index d9006349..5faef0df 100644
--- a/libyasm/floatnum.c
+++ b/libyasm/floatnum.c
@@ -421,16 +421,17 @@ floatnum_new(const char *str)
dec_exponent += dec_exp_add;
}
+ /* Free calculation variables. */
+ BitVector_Destroy(operand[1]);
+ BitVector_Destroy(operand[0]);
+
/* Normalize the number, checking for 0 first. */
if (BitVector_is_empty(flt->mantissa)) {
/* Mantissa is 0, zero exponent too. */
flt->exponent = 0;
/* Set zero flag so output functions don't see 0 value as underflow. */
flt->flags |= FLAG_ISZERO;
- /* Free calculation variables and return. */
- BitVector_Destroy(operand[1]);
- BitVector_Destroy(operand[0]);
-
+ /* Return 0 value. */
return flt;
}
/* Exponent if already norm. */