[goffice] Regression: plug leak.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [goffice] Regression: plug leak.
- Date: Sun, 28 Oct 2012 21:37:50 +0000 (UTC)
commit 4fb4c3aa158b0480242f1f0909eb12d87a4617a9
Author: Morten Welinder <terra gnome org>
Date: Sun Oct 28 17:37:37 2012 -0400
Regression: plug leak.
ChangeLog | 5 ++++-
goffice/math/go-regression.c | 19 +++++++++++++------
2 files changed, 17 insertions(+), 7 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 5f813ad..811b28b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,9 @@
2012-10-28 Morten Welinder <terra gnome org>
- * goffice/app/go-conf-gsettings.c (go_conf_free_node): plug leak.
+ * goffice/math/go-regression.c (go_regression_stat_destroy): Plug
+ leak.
+
+ * goffice/app/go-conf-gsettings.c (go_conf_free_node): Plug leak.
(go_conf_get_node): Plug leak.
* goffice/graph/gog-theme.c (gog_theme_finalize): Get rid of ->dcm
diff --git a/goffice/math/go-regression.c b/goffice/math/go-regression.c
index bffee08..e6b3a3c 100644
--- a/goffice/math/go-regression.c
+++ b/goffice/math/go-regression.c
@@ -1570,12 +1570,19 @@ SUFFIX(go_regression_stat_new) (void)
void
SUFFIX(go_regression_stat_destroy) (SUFFIX(go_regression_stat_t) *stat_)
{
- if (stat_ && stat_->ref_count-- > 1) {
- g_free(stat_->se);
- g_free(stat_->t);
- g_free(stat_->xbar);
- g_free (stat_);
- }
+ if (!stat_)
+ return;
+
+ g_return_if_fail (stat_->ref_count > 0);
+
+ stat_->ref_count--;
+ if (stat_->ref_count > 0)
+ return;
+
+ g_free (stat_->se);
+ g_free (stat_->t);
+ g_free (stat_->xbar);
+ g_free (stat_);
}
/* ------------------------------------------------------------------------- */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]