[libgda] More corrections thanks to CppCkeck



commit b981a5587b6e667305345fa0436fb2c12968f7ad
Author: Vivien Malerba <malerba gnome-db org>
Date:   Fri Oct 2 20:56:12 2009 +0200

    More corrections thanks to CppCkeck

 providers/mdb/gda-mdb-provider.c       |    8 ++++----
 providers/oracle/gda-oracle-provider.c |    1 +
 testing/html.c                         |    2 +-
 tools/browser/common/objects-cloud.c   |    2 ++
 4 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/providers/mdb/gda-mdb-provider.c b/providers/mdb/gda-mdb-provider.c
index 63820b8..78450ad 100644
--- a/providers/mdb/gda-mdb-provider.c
+++ b/providers/mdb/gda-mdb-provider.c
@@ -254,7 +254,7 @@ gda_mdb_provider_open_connection (GdaServerProvider *provider, GdaConnection *cn
 			if (g_str_has_suffix (str, FILE_EXTENSION)) {
                                 gchar *ptr;
 
-                                dup = strdup (str);
+                                dup = g_strdup (str);
                                 dup [len-elen] = 0;
                                 for (ptr = dup + (len - elen - 1); (ptr >= dup) && (*ptr != G_DIR_SEPARATOR); ptr--);
                                 dbname = ptr;
@@ -512,9 +512,9 @@ table_create_model_func (LocalSpec *spec)
         /* free memory */
         g_free (coltypes);
         for (c = 0; c < mdb_table->num_cols; c++)
-                g_free (bound_values [c]);
-	free (bound_values);
-	free (bound_len);
+                free (bound_values [c]);
+	g_free (bound_values);
+	g_free (bound_len);
 
 	g_object_set (G_OBJECT (model), "read-only", TRUE, NULL);
 	return model;
diff --git a/providers/oracle/gda-oracle-provider.c b/providers/oracle/gda-oracle-provider.c
index 69022a6..93d4c0d 100644
--- a/providers/oracle/gda-oracle-provider.c
+++ b/providers/oracle/gda-oracle-provider.c
@@ -1828,6 +1828,7 @@ gda_oracle_provider_statement_execute (GdaServerProvider *provider, GdaConnectio
 					(ub4) 0,
 					(ub4 *) 0,
 					(ub4) OCI_DEFAULT);
+		_gda_oracle_value_free (ora_value);
 		if ((event = gda_oracle_check_result (result, cnc, cdata, OCI_HTYPE_ERROR,
 						      _("Could not bind the Oracle statement parameter"))))
 			break;
diff --git a/testing/html.c b/testing/html.c
index 059efec..052ff54 100644
--- a/testing/html.c
+++ b/testing/html.c
@@ -338,7 +338,6 @@ html_render_data_model (xmlNodePtr parent, GdaDataModel *model)
 			tr = xmlNewChild (node, NULL, "tr", "");
                         for (c = 0 ; c < cols; c++) {
                                 GValue *value;
-                                gchar *str;
 
                                 value = (GValue *) gda_data_model_get_value_at (model, c, r, NULL);
 				if (!value) {
@@ -354,6 +353,7 @@ html_render_data_model (xmlNodePtr parent, GdaDataModel *model)
 					xmlSetProp(p, "class", (xmlChar*)"null");
 				}
 				else {
+					gchar *str;
 					if (G_VALUE_TYPE (value) == G_TYPE_BOOLEAN)
 						str = g_strdup (g_value_get_boolean (value) ? "TRUE" : "FALSE");
 					else
diff --git a/tools/browser/common/objects-cloud.c b/tools/browser/common/objects-cloud.c
index c367688..1829b09 100644
--- a/tools/browser/common/objects-cloud.c
+++ b/tools/browser/common/objects-cloud.c
@@ -177,6 +177,8 @@ update_display (ObjectsCloud *cloud)
 	mstruct = cloud->priv->mstruct;
 	if (!mstruct) {
 		/* nothing to display */
+		g_object_unref (sd->mark);
+		g_free (sd);
 		return;
 	}
 	dbo_list = g_slist_reverse (gda_meta_struct_get_all_db_objects (mstruct));



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