gnumeric r16991 - in trunk: . plugins/fn-stat src



Author: mortenw
Date: Mon Dec  8 18:15:49 2008
New Revision: 16991
URL: http://svn.gnome.org/viewvc/gnumeric?rev=16991&view=rev

Log:
2008-12-08  Morten Welinder  <terra gnome org>

	* src/gnm-plugin.c (plugin_service_ui_activate): Plug leak.

	* src/ssgrep.c (main): Plug leak.
	* src/ssconvert.c (main): Plug leak.
	* src/ssindex.c (main): Plug leak.

2008-12-08  Morten Welinder  <terra gnome org>

	* functions.c (gnumeric_trimmean): Plug leak.
	(gnumeric_rank): Plug leak.



Modified:
   trunk/ChangeLog
   trunk/NEWS
   trunk/plugins/fn-stat/ChangeLog
   trunk/plugins/fn-stat/functions.c
   trunk/src/gnm-plugin.c
   trunk/src/ssconvert.c
   trunk/src/ssgrep.c
   trunk/src/ssindex.c

Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS	(original)
+++ trunk/NEWS	Mon Dec  8 18:15:49 2008
@@ -47,6 +47,9 @@
 	* Fix crash in multi-view mode.  [#562053]
 	* Introduce explicit () on parsing -2^2.  [#115941]
 	* Fix inter-process paste crash.  [#556561]
+	* Plug leak in TRIMMEAN.
+	* Plug leak in RANK.
+	* Plug leaks in ssindex, ssgrep, and ssconvert.
 
 --------------------------------------------------------------------------
 Gnumeric 1.9.3

Modified: trunk/plugins/fn-stat/functions.c
==============================================================================
--- trunk/plugins/fn-stat/functions.c	(original)
+++ trunk/plugins/fn-stat/functions.c	Mon Dec  8 18:15:49 2008
@@ -194,7 +194,7 @@
 	order = argv[2] ? value_get_as_int (argv[2]) : 0;
 
 	if (result)
-		return result;
+		goto out;
 
 	for (i = 0, r = 1; i < n; i++) {
 		gnm_float y = xs[i];
@@ -203,7 +203,12 @@
 			r++;
 	}
 
-	return value_new_int (r);
+	result = value_new_int (r);
+
+ out:
+	g_free (xs);
+
+	return result;
 }
 
 /***************************************************************************/
@@ -237,17 +242,23 @@
 	gnm_float res;
 
 	if (result)
-		return result;
+		goto out;
 
-	if (p < 0 || p > 1)
-		return value_new_error_VALUE (ei->pos);
+	if (p < 0 || p > 1) {
+		result = value_new_error_VALUE (ei->pos);
+		goto out;
+	}
 
 	tc = (int)gnm_fake_floor ((n * p) / 2);
 	c = n - 2 * tc;
 	if (gnm_range_average (xs + tc, c, &res))
-		return value_new_error_VALUE (ei->pos);
+		result = value_new_error_VALUE (ei->pos);
+	else
+		result = value_new_float (res);
 
-	return value_new_float (res);
+	g_free (xs);
+ out:
+	return result;
 }
 
 /***************************************************************************/

Modified: trunk/src/gnm-plugin.c
==============================================================================
--- trunk/src/gnm-plugin.c	(original)
+++ trunk/src/gnm-plugin.c	Mon Dec  8 18:15:49 2008
@@ -371,9 +371,12 @@
 		go_plugin_get_dir_name (service->plugin),
 		service_ui->file_name, NULL);
 	if (!g_file_get_contents (full_file_name, &xml_ui, NULL, &err)) {
-		*ret_error = error_info_new_printf (
-		             _("Cannot read UI description from XML file %s."),
-		             full_file_name);
+		*ret_error = error_info_new_printf
+			(_("Cannot read UI description from XML file %s: %s"),
+			 full_file_name,
+			 err ? err->message : "?");
+		if (err)
+			g_error_free (err);
 		g_free (full_file_name);
 		return;
 	}

Modified: trunk/src/ssconvert.c
==============================================================================
--- trunk/src/ssconvert.c	(original)
+++ trunk/src/ssconvert.c	Mon Dec  8 18:15:49 2008
@@ -25,6 +25,7 @@
 #include <dialogs/dialogs.h>
 #include <goffice/app/file.h>
 #include <goffice/app/io-context.h>
+#include <goffice/app/error-info.h>
 #include <goffice/app/go-doc.h>
 #include <goffice/app/go-cmd-context.h>
 #include <goffice/utils/go-file.h>
@@ -383,6 +384,10 @@
 	gnm_plugins_init (GO_CMD_CONTEXT (cc));
 	go_plugin_db_activate_plugin_list (
 		go_plugins_get_available_plugins (), &plugin_errs);
+	if (plugin_errs) {
+		/* FIXME: What do we want to do here? */
+		error_info_free (plugin_errs);
+	}
 
 	if (ssconvert_list_exporters)
 		list_them (&go_get_file_savers,

Modified: trunk/src/ssgrep.c
==============================================================================
--- trunk/src/ssgrep.c	(original)
+++ trunk/src/ssgrep.c	Mon Dec  8 18:15:49 2008
@@ -13,6 +13,7 @@
 #include <goffice/app/go-plugin.h>
 #include "command-context-stderr.h"
 #include <goffice/app/io-context.h>
+#include <goffice/app/error-info.h>
 #include "workbook-view.h"
 #include "workbook.h"
 #include "gutils.h"
@@ -520,6 +521,10 @@
 	gnm_plugins_init (GO_CMD_CONTEXT (cc));
 	go_plugin_db_activate_plugin_list (
 		go_plugins_get_available_plugins (), &plugin_errs);
+	if (plugin_errs) {
+		/* FIXME: What do we want to do here? */
+		error_info_free (plugin_errs);
+	}
 
 	ioc = gnumeric_io_context_new (cc);
 	gnm_io_context_set_num_files (ioc, N);

Modified: trunk/src/ssindex.c
==============================================================================
--- trunk/src/ssindex.c	(original)
+++ trunk/src/ssindex.c	Mon Dec  8 18:15:49 2008
@@ -16,6 +16,7 @@
 #include <goffice/app/go-plugin.h>
 #include "command-context-stderr.h"
 #include <goffice/app/io-context.h>
+#include <goffice/app/error-info.h>
 #include "workbook-view.h"
 #include <goffice/app/file.h>
 #include "workbook.h"
@@ -231,6 +232,10 @@
 	gnm_plugins_init (GO_CMD_CONTEXT (cc));
 	go_plugin_db_activate_plugin_list (
 		go_plugins_get_available_plugins (), &plugin_errs);
+	if (plugin_errs) {
+		/* FIXME: What do we want to do here? */
+		error_info_free (plugin_errs);
+	}
 
 	if (ssindex_run_indexer) {
 		IOContext *ioc = gnumeric_io_context_new (cc);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]