[libgda] Small correction to GdaConnection



commit 4e6c0dff9ca19312f515b8a0be7084e0939bdfc8
Author: Vivien Malerba <malerba gnome-db org>
Date:   Thu Aug 4 19:29:02 2011 +0200

    Small correction to GdaConnection

 libgda/gda-connection.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/libgda/gda-connection.c b/libgda/gda-connection.c
index 63dc207..b821779 100644
--- a/libgda/gda-connection.c
+++ b/libgda/gda-connection.c
@@ -2730,7 +2730,7 @@ make_col_types_array (va_list args)
 {
 	GType *types;
 	gint max = 10;
-	gint col;
+	gint col, lastidx = 0;
 
 	types = g_new0 (GType, max + 1);
 	types [max] = G_TYPE_NONE;
@@ -2744,7 +2744,16 @@ make_col_types_array (va_list args)
 			types [max] = G_TYPE_NONE;
 		}
 		types [col] = va_arg (args, GType);
+		lastidx = col+1;
 	}
+
+	if (lastidx == 0) {
+		g_free (types);
+		types = NULL;
+	}
+	else
+		types [lastidx] = G_TYPE_NONE;
+
 	return types;
 }
 



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