[gnumeric] fix leak in src/dialogs/dialog-doc-metadata.c
- From: Andreas J. Guelzow <guelzow src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] fix leak in src/dialogs/dialog-doc-metadata.c
- Date: Sat, 18 Dec 2010 01:32:19 +0000 (UTC)
commit b007cff9f3b6b4b3b550aace34adb8bbc4815f2a
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date: Fri Dec 17 18:31:36 2010 -0700
fix leak in src/dialogs/dialog-doc-metadata.c
2010-12-17 Andreas J. Guelzow <aguelzow pyrshep ca>
* dialog-doc-metadata.c (dialog_doc_metadata_set_gsf_prop): avoid leak
src/dialogs/ChangeLog | 4 ++++
src/dialogs/dialog-doc-metadata.c | 9 +++++----
2 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/src/dialogs/ChangeLog b/src/dialogs/ChangeLog
index c93bb2e..3c9f05a 100644
--- a/src/dialogs/ChangeLog
+++ b/src/dialogs/ChangeLog
@@ -1,5 +1,9 @@
2010-12-17 Andreas J. Guelzow <aguelzow pyrshep ca>
+ * dialog-doc-metadata.c (dialog_doc_metadata_set_gsf_prop): avoid leak
+
+2010-12-17 Andreas J. Guelzow <aguelzow pyrshep ca>
+
* dialog-advanced-filter.c (advanced_filter_ok_clicked_cb):
add argument to cmd_analysis_tool
* dialog-analysis-tool-chi-squared.c (chi_squared_tool_ok_clicked_cb):
diff --git a/src/dialogs/dialog-doc-metadata.c b/src/dialogs/dialog-doc-metadata.c
index 47e582c..9d382ec 100644
--- a/src/dialogs/dialog-doc-metadata.c
+++ b/src/dialogs/dialog-doc-metadata.c
@@ -561,7 +561,6 @@ dialog_doc_metadata_set_gsf_prop (DialogDocMetaData *state,
GsfDocProp *doc_prop;
GValue *existing_value = NULL;
char const *existing_link = NULL;
- GValue *doc_prop_value;
GType val_type;
existing_prop = gsf_doc_meta_data_lookup (state->metadata, name);
@@ -607,12 +606,14 @@ dialog_doc_metadata_set_gsf_prop (DialogDocMetaData *state,
/* Create a new GsfDocProp */
doc_prop = gsf_doc_prop_new (g_strdup (name));
- /* Create a new Value */
- doc_prop_value = g_new0 (GValue, 1);
-
val_type = dialog_doc_metadata_get_gsf_prop_val_type (state, name);
if (val_type != G_TYPE_INVALID) {
+ GValue *doc_prop_value;
+
+ /* Create a new Value */
+ doc_prop_value = g_new0 (GValue, 1);
+
g_value_init (doc_prop_value, val_type);
dialog_doc_metadata_set_gsf_prop_val (state, doc_prop_value, value);
gsf_doc_prop_set_val (doc_prop, doc_prop_value);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]