if (ipdopts->param_status_ptr)
ipdopts->param_status_ptr[stmt->exec_current_row] = SQL_PARAM_ERROR;
+ /*
+ * Free any data at exec params before the statement is
+ * executed again or the next set of parameters is processed.
+ * If not, then there will be a memory leak when the next
+ * SQLParamData/SQLPutData is called.
+ */
+ SC_free_params(stmt, STMT_FREE_PARAMS_DATA_AT_EXEC_ONLY);
+
/*
* Check if statement has any data-at-execute parameters when it is
* not in SC_pre_execute.
{
/* Waiting for more data from SQLParamData/SQLPutData. Cancel that. */
/*
- * Note, any previous data-at-exec buffers will be freed in the
- * recycle
+ * Note, any previous data-at-exec buffers will be freed
+ * if they call SQLExecDirect or SQLExecute again.
*/
- /* if they call SQLExecDirect or SQLExecute again. */
ENTER_STMT_CS(stmt);
SC_clear_error(stmt);
self->lobj_fd = -1;
- /*
- * Free any data at exec params before the statement is executed
- * again. If not, then there will be a memory leak when the next
- * SQLParamData/SQLPutData is called.
- */
SC_free_params(self, STMT_FREE_PARAMS_DATA_AT_EXEC_ONLY);
SC_initialize_stmts(self, FALSE);
cancelNeedDataState(self);