joeferner/node-oracle — pull request #233 by barakedry (2014-11-06 14:36:29+00:00)
Title: Statement object may be unreferenced and destructed before result callback is being fired

oracle.connect(connectData, function (error, connection) {

var statement;
for (var i = 0; i < 1000; i++) {
statement = connection.prepare('SELECT * FROM DUAL);
statement.execute([], function (err, result) {
// statement object might be garbage collected by now.. if it does it will crash
});
}

}

statement.cpp line 25
Statement::~Statement() {
delete m_baton;
m_baton = NULL;
}

delete m_baton might be called because the statement could be unreferenced before EIO_AfterExecute will be called (line 87)
req->data // garbage

I also fixed ../src/executeBaton.cpp:271:123: error: call to 'pow' is ambiguous
made some problems when compiling under OS X 10.10