[gnumeric] leak fix.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] leak fix.
- Date: Fri, 17 Dec 2010 14:58:41 +0000 (UTC)
commit 7b57360b2ad4d0737e257ba0542bb00c43b0e0dc
Author: Morten Welinder <terra gnome org>
Date: Fri Dec 17 09:58:17 2010 -0500
leak fix.
plugins/fn-derivatives/ChangeLog | 4 ++++
plugins/fn-derivatives/options.c | 8 ++++----
src/dependent.c | 1 +
3 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/plugins/fn-derivatives/ChangeLog b/plugins/fn-derivatives/ChangeLog
index 9f1e743..a410a65 100644
--- a/plugins/fn-derivatives/ChangeLog
+++ b/plugins/fn-derivatives/ChangeLog
@@ -1,3 +1,7 @@
+2010-12-17 Morten Welinder <terra gnome org>
+
+ * options.c (opt_binomial): Fix leak on error.
+
2010-11-25 Morten Welinder <terra gnome org>
* Release 1.10.12
diff --git a/plugins/fn-derivatives/options.c b/plugins/fn-derivatives/options.c
index 4b5a7a0..3ee93fc 100644
--- a/plugins/fn-derivatives/options.c
+++ b/plugins/fn-derivatives/options.c
@@ -1910,10 +1910,6 @@ opt_binomial(GnmFuncEvalInfo *ei, GnmValue const * const *argv)
if (n < 0 || n > 100000)
return value_new_error_NUM (ei->pos);
- value_array = (gnm_float *) g_try_malloc ((n + 2)* sizeof(gnm_float));
- if (value_array == NULL)
- return value_new_error_NUM (ei->pos);
-
if (OS_Call == call_put_flag)
z = 1;
else if (OS_Put == call_put_flag)
@@ -1924,6 +1920,10 @@ opt_binomial(GnmFuncEvalInfo *ei, GnmValue const * const *argv)
if (OT_Error == amer_euro_flag)
return value_new_error_NUM (ei->pos);
+ value_array = (gnm_float *) g_try_malloc ((n + 2)* sizeof(gnm_float));
+ if (value_array == NULL)
+ return value_new_error_NUM (ei->pos);
+
dt = t / n;
u = gnm_exp (v * gnm_sqrt (dt));
d = 1.0 / u;
diff --git a/src/dependent.c b/src/dependent.c
index aeff995..814fb0e 100644
--- a/src/dependent.c
+++ b/src/dependent.c
@@ -2089,6 +2089,7 @@ dependents_relocate (GnmExprRelocateInfo const *rinfo)
tmp->dep_type = t;
if (t == DEPENDENT_NAME) {
+#warning "What should we do here and why do we leak tmp?"
} else {
if (t == DEPENDENT_CELL)
tmp->u.pos = local_rinfo.pos;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]