[libgda] Fix memory leak at SQLite provider prepare statement
- From: Daniel Espinosa Ortiz <despinosa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda] Fix memory leak at SQLite provider prepare statement
- Date: Mon, 15 Apr 2019 03:12:49 +0000 (UTC)
commit a60fcccebbd73add74f980589e6b6c1d52d65ae4
Author: Daniel Espinosa <esodan gmail com>
Date: Sun Apr 14 21:03:19 2019 -0500
Fix memory leak at SQLite provider prepare statement
libgda/gda-set.c | 1 -
libgda/sql-parser/gda-statement-struct-util.c | 2 +-
libgda/sqlite/gda-sqlite-provider.c | 2 ++
tests/gda-test.c | 2 +-
4 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/libgda/gda-set.c b/libgda/gda-set.c
index 07ceef2ff..8724367af 100644
--- a/libgda/gda-set.c
+++ b/libgda/gda-set.c
@@ -1407,7 +1407,6 @@ gda_set_new_from_spec_string (const gchar *xml_spec, GError **error)
xmlFreeDtd (gda_paramlist_dtd);
gda_paramlist_dtd = NULL;
}
- g_assert (gda_paramlist_dtd == NULL);
xmlDoValidityCheckingDefaultValue = xmlcheck;
g_free (validc);
}
diff --git a/libgda/sql-parser/gda-statement-struct-util.c b/libgda/sql-parser/gda-statement-struct-util.c
index c7bfd5bb7..746c31bb9 100644
--- a/libgda/sql-parser/gda-statement-struct-util.c
+++ b/libgda/sql-parser/gda-statement-struct-util.c
@@ -344,8 +344,8 @@ gda_sql_identifier_prepare_for_compare (gchar *str)
gchar *ptr;
for (ptr = str; *ptr; ptr++)
*ptr = g_ascii_tolower (*ptr);
- return str;
}
+ return str;
}
/*
diff --git a/libgda/sqlite/gda-sqlite-provider.c b/libgda/sqlite/gda-sqlite-provider.c
index f61243ec3..7b3747b4b 100644
--- a/libgda/sqlite/gda-sqlite-provider.c
+++ b/libgda/sqlite/gda-sqlite-provider.c
@@ -2982,6 +2982,8 @@ real_prepare (GdaServerProvider *provider, GdaConnection *cnc, GdaStatement *stm
g_object_unref (real_stmt);
/*g_print ("%s(%s) => GdaSqlitePStmt %p\n", __FUNCTION__, sql, ps);*/
g_free (sql);
+ if (hash)
+ g_hash_table_destroy (hash);
return ps;
out_err:
diff --git a/tests/gda-test.c b/tests/gda-test.c
index 4a898caed..eb21a5bec 100644
--- a/tests/gda-test.c
+++ b/tests/gda-test.c
@@ -14,7 +14,7 @@ int main() {
g_message ("Error messages: %s", error->message);
}
g_object_unref(cnc);
- g_message ("Exists without errors");
+ g_message ("Test finished");
return EXIT_SUCCESS;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]