mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 00:04:37 +02:00
2012-01-19 Ramon Novoa <rnovoa@artica.es>
* modules/pandora_module_odbc.cc: Check for NULL pointers. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5392 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
8d1d6d5eec
commit
9ab9ae3784
@ -1,3 +1,7 @@
|
|||||||
|
2012-01-19 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
|
* modules/pandora_module_odbc.cc: Check for NULL pointers.
|
||||||
|
|
||||||
2012-01-04 Ramon Novoa <rnovoa@artica.es>
|
2012-01-04 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
* modules/pandora_module.cc: Fixed an error when checking multiple
|
* modules/pandora_module.cc: Fixed an error when checking multiple
|
||||||
|
@ -143,13 +143,28 @@ void
|
|||||||
Pandora_Module_Odbc::doQuery () {
|
Pandora_Module_Odbc::doQuery () {
|
||||||
string retval;
|
string retval;
|
||||||
auto_ptr<Statement> statement;
|
auto_ptr<Statement> statement;
|
||||||
|
Statement *statement_ptr;
|
||||||
auto_ptr<ResultSet> results;
|
auto_ptr<ResultSet> results;
|
||||||
|
ResultSet *results_ptr;
|
||||||
ResultSetMetaData *metadata;
|
ResultSetMetaData *metadata;
|
||||||
int columns;
|
int columns;
|
||||||
|
|
||||||
statement = auto_ptr<Statement> (this->con->createStatement ());
|
statement_ptr = this->con->createStatement ();
|
||||||
results = auto_ptr<ResultSet> (statement->executeQuery (query));
|
if (statement_ptr == NULL) {
|
||||||
metadata = results->getMetaData ();
|
return;
|
||||||
|
}
|
||||||
|
statement = auto_ptr<Statement> (statement_ptr);
|
||||||
|
|
||||||
|
results_ptr = statement->executeQuery (query);
|
||||||
|
if (results_ptr == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
results = auto_ptr<ResultSet> (results_ptr);
|
||||||
|
metadata = results->getMetaData ();
|
||||||
|
if (metadata == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
columns = metadata->getColumnCount ();
|
columns = metadata->getColumnCount ();
|
||||||
|
|
||||||
if (results->next ()) {
|
if (results->next ()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user