Commit Graph
17 Commits
Author SHA1 Message Date
William Rogers 4148518906 Freed memory on SQL engine termination
Modified mdb_sql_exit to free the memory allocated for the SQL engine in mdb_sql_init
2015-05-24 18:04:14 -05:00
William Rogers d0472d96ba Added proper SQL engine termination
Since the SQL engine is initialized in _SQLAllocEnv, the engine should be also terminated in SQLFreeEnv.
2015-05-24 17:38:50 -05:00
William Rogers 82e3436494 Corrected memory being improperly freed
The memory for sql->bound_values is now freed by mdb_sql_reset, so these values no longer should be freed in dump_results_pp.  Also, this fixes a memory leak that was occurring when results were not being pretty printed.
2015-05-24 17:15:52 -05:00
William Rogers 0123d7e1c2 Fixed memory leak - sql->bound_values
Memory allocated by mdb_sql_bind_all for sql->bound_values was being leaked at each query execution.  Memory is now freed in mdb_sql_reset
2015-05-24 17:12:29 -05:00
William Rogers 9276aca347 Consolidated calls to mdb_sql_reset
SQL engine was being reset in both dump_results functions.  Rather than having several different functions responsible for resetting the engine depending on the circumstances, the reset now only occurs in run_query, the same function where the query is executed.
2015-05-24 17:05:41 -05:00
William Rogers bcc7ad5a7a Fixed memory leak in _SQLFreeEnv
Memory allocated for the _henv structure was not being freed which caused a small memory leak.
2015-05-24 16:49:44 -05:00
William Rogers 5888c4a52c Correction to SQLGetData string length handling
According to http://download.oracle.com/otn_hosted_doc/timesten/703/TimesTen-Documentation/ms.odbc.pdf and https://msdn.microsoft.com/en-us/library/ms710980(v=vs.85).aspx, the string length should not include the NULL character at the end.

Previous behavior would likely work without problems for any language that uses C-style null terminated strings, but adds a null character in the string when using the driver with a language that does not use C-style strings.
2015-05-22 20:10:10 -05:00
William Rogers dca7552d8b Implemented SQL_DESC_UNSIGNED attribute in SQLColAttributes 2015-05-22 16:30:13 -05:00
William Rogers 0bbe5d3ee6 Memory leak fix
Free the col->sargs
2013-06-27 20:58:43 +02:00
William Rogers 1d39126de6 Memory leak wrong fix
Free col->sargs
Note this patch causes SEGV
2013-06-27 16:09:53 +02:00
William Rogers 04daf7cab5 Memory leak fix
Need to free parent in mdb_sql_free_tree
2013-06-27 11:13:39 +02:00
William Rogers ecc72f8faf mdb_sql_bind_all already in mdb_sql_run_query 2013-06-26 12:13:44 +02:00
William Rogers 6043e22a43 Memory leak fix in odbc
Free the stmt->bind_head list on Stmt
Reset row_affected on FreeStmt
2013-06-26 11:33:26 +02:00
William Rogers 6326e54e82 Fix mem leak in SQLGetData
Free temporary string when we are past result length and we return SQL_NO_DATA
2013-06-26 10:13:05 +02:00
William Rogers fd6e52f9bd Fixed MDBProps memory leaks 2013-06-25 21:33:38 +02:00
William Rogers 23942c19d3 Update _SQLGetData - Was incorrectly attempting to validate input of an output only parameter
According to the spec, pcbValue is designated as an output only variable, so there is no need to validate any incoming values.

Some packages do not initialize this variable before passing it into the function call; this will randomly result in an improperly thrown error.

Removed the input validation.
2013-06-23 18:28:43 +02:00
rogerswb 40d1ecd11f Update _SQLGetData - Was incorrectly attempting to validate input of an output only parameter
According to the spec, pcbValue is designated as an output only variable, so there is no need to validate any incoming values.

Some packages do not initialize this variable before passing it into the function call; this will randomly result in an improperly thrown error.

Removed the input validation.
2013-05-23 14:58:19 -05:00