Index: /trunk/psLib/src/db/psDB.c
===================================================================
--- /trunk/psLib/src/db/psDB.c	(revision 9689)
+++ /trunk/psLib/src/db/psDB.c	(revision 9690)
@@ -12,6 +12,6 @@
  *  @author Joshua Hoblitt
  *
- *  @version $Revision: 1.105 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-10-21 00:33:00 $
+ *  @version $Revision: 1.106 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-10-21 01:09:37 $
  *
  *  Copyright (C) 2005-2006  Joshua Hoblitt, University of Hawaii
@@ -880,6 +880,4 @@
         psMetadata *rowData = rowSet->data[j];
 
-        psDBMysqlRowRecycle(mysqlRow);
-
         if (!psDBPackMySQLRow(mysqlRow, rowData)) {
             psError(PS_ERR_UNKNOWN, false, "Failed to pack params into bind structure.");
@@ -908,4 +906,8 @@
             return -1;
         }
+
+        // free temporary buffers
+        psDBMysqlRowRecycle(mysqlRow);
+
     } // end loop over rows
 
@@ -1168,5 +1170,5 @@
 
                 bind[i].buffer  = myTime;
-                bind[i].buffer_length = 0;
+                bind[i].buffer_length = sizeof(MYSQL_TIME);
                 bind[i].length  = &bind[i].buffer_length;
                 bind[i].is_null = NULL;
@@ -1232,4 +1234,6 @@
         }
     }
+
+    memset(bind, '\0', sizeof(MYSQL_BIND) * mysqlRow->n);
 }
 
