Index: /trunk/zoo-project/zoo-kernel/Makefile.in
===================================================================
--- /trunk/zoo-project/zoo-kernel/Makefile.in	(revision 733)
+++ /trunk/zoo-project/zoo-kernel/Makefile.in	(revision 734)
@@ -40,5 +40,5 @@
 
 sqlapi.o: sqlapi.c sqlapi.h
-	g++ -fPIC ${XML2CFLAGS} ${CFLAGS} ${JSCFLAGS} ${JS_ENABLED} -c sqlapi.c
+	g++ -fPIC ${GDAL_CFLAGS} ${XML2CFLAGS} ${CFLAGS} ${JSCFLAGS} ${JS_ENABLED} -c sqlapi.c
 
 caching.o: caching.c
Index: /trunk/zoo-project/zoo-kernel/sqlapi.c
===================================================================
--- /trunk/zoo-project/zoo-kernel/sqlapi.c	(revision 733)
+++ /trunk/zoo-project/zoo-kernel/sqlapi.c	(revision 734)
@@ -183,4 +183,5 @@
     sprintf(sqlQuery,"INSERT INTO %s.files (uuid,filename,nature,name) VALUES ('%s','%s','%s',NULL);",schema->value,uusid->value,filename,type);
   execSql(conf,sqlQuery);
+  free(sqlQuery);
   cleanUpResultSet(conf);
 }
@@ -206,4 +207,5 @@
 	  uusid->value,sid->value,osid->value);
   execSql(conf,sqlQuery);
+  free(sqlQuery);
   cleanUpResultSet(conf);
 }
@@ -229,4 +231,6 @@
   sprintf(sqlQuery,"INSERT INTO %s.responses (content,uuid) VALUES ($$%s$$,$$%s$$);",schema->value,tmps,sid->value);
   execSql(conf,sqlQuery);
+  free(sqlQuery);
+  free(tmps);
   cleanUpResultSet(conf);
 }
@@ -250,4 +254,5 @@
   execSql(conf,sqlQuery);
   cleanUpResultSet(conf);
+  free(sqlQuery);
   return 0;
 }
@@ -280,4 +285,5 @@
   }
   cleanUpResultSet(conf);
+  free(sqlQuery);
   return (char*)tmp1;
 }
@@ -316,4 +322,5 @@
     tmp1=NULL;
   cleanUpResultSet(conf);
+  free(sqlQuery);
   return (char*)tmp1;
 }
@@ -338,4 +345,5 @@
   cleanUpResultSet(conf);
   close_sql(conf);
+  free(sqlQuery);
   end_sql();
 }
@@ -363,4 +371,5 @@
   cleanUpResultSet(conf);
   close_sql(conf);
+  free(sqlQuery);
   end_sql();
 }
@@ -397,4 +406,5 @@
   if(hasRes<0)
     tmp1=NULL;
+  free(sqlQuery);
   return (char*)tmp1;
 }
@@ -429,4 +439,5 @@
   if(hasRes<0)
     addToMap(statusInfo,"Status","Failed");
+  free(sqlQuery);
   return;
 }
@@ -460,4 +471,5 @@
   }
   cleanUpResultSet(conf);
+  free(sqlQuery);
   return res;
 }
