[libsoup] Reset error pointer to NULL when we are about to use it again.



commit b64e2ac56980c2c762fd1a6af021f919218d6ccb
Author: Xan Lopez <xan gnome org>
Date:   Tue Sep 1 18:46:23 2009 +0300

    Reset error pointer to NULL when we are about to use it again.
    
    Just in case sqlite expects this to be the case a la GError.
    
    Also use NULL instead of 0 to initialize the error pointers elsewhere.

 libsoup/soup-cookie-jar-sqlite.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/libsoup/soup-cookie-jar-sqlite.c b/libsoup/soup-cookie-jar-sqlite.c
index 19d1827..5ec9a75 100644
--- a/libsoup/soup-cookie-jar-sqlite.c
+++ b/libsoup/soup-cookie-jar-sqlite.c
@@ -221,7 +221,7 @@ callback (void *data, int argc, char **argv, char **colname)
 static void
 try_create_table (sqlite3 *db)
 {
-	char *error = 0;
+	char *error = NULL;
 
 	if (sqlite3_exec (db, CREATE_TABLE, NULL, NULL, &error)) {
 		g_warning ("Failed to execute query: %s", error);
@@ -235,7 +235,7 @@ exec_query_with_try_create_table (sqlite3 *db,
 				  int (*callback)(void*,int,char**,char**),
 				  void *argument)
 {
-	char *error = 0;
+	char *error = NULL;
 	gboolean try_create = TRUE;
 
 try_exec:
@@ -244,6 +244,7 @@ try_exec:
 			try_create = FALSE;
 			try_create_table (db);
 			sqlite3_free (error);
+			error = NULL;
 			goto try_exec;
 		} else {
 			g_warning ("Failed to execute query: %s", error);



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