[libgda/LIBGDA_4.0] Correction in GdaBlob copy



commit 296a903bd1c97cbb836b5e74a1803736132dd4df
Author: Vivien Malerba <malerba gnome-db org>
Date:   Wed Dec 30 22:21:02 2009 +0100

    Correction in GdaBlob copy

 libgda/gda-value.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/libgda/gda-value.c b/libgda/gda-value.c
index 5e91327..a232225 100644
--- a/libgda/gda-value.c
+++ b/libgda/gda-value.c
@@ -423,8 +423,10 @@ gda_blob_copy (gpointer boxed)
 	g_return_val_if_fail (src, NULL);
 
 	copy = g_new0 (GdaBlob, 1);
-	((GdaBinary *)copy)->data = g_memdup (((GdaBinary *)src)->data, ((GdaBinary *)src)->binary_length);
-	((GdaBinary *)copy)->binary_length = ((GdaBinary *)src)->binary_length;
+	if (((GdaBinary *)src)->data) {
+		((GdaBinary *)copy)->data = g_memdup (((GdaBinary *)src)->data, ((GdaBinary *)src)->binary_length);
+		((GdaBinary *)copy)->binary_length = ((GdaBinary *)src)->binary_length;
+	}
 	gda_blob_set_op (copy, src->op);
 	
 	return copy;



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