Skip to content

Commit 5eeb061

Browse files
committed
fixed req memory leak in all async calls
1 parent 78cfca4 commit 5eeb061

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

src/connection.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ void Connection::EIO_AfterCommit(uv_work_t* req, int status) {
391391
argv[0] = Undefined();
392392
node::MakeCallback(Context::GetCurrent()->Global(), uni::Deref(baton->callback), 2, argv);
393393
delete baton;
394-
394+
delete req;
395395
}
396396

397397
void Connection::EIO_Rollback(uv_work_t* req) {
@@ -410,7 +410,7 @@ void Connection::EIO_AfterRollback(uv_work_t* req, int status) {
410410
argv[0] = Undefined();
411411
node::MakeCallback(Context::GetCurrent()->Global(), uni::Deref(baton->callback), 2, argv);
412412
delete baton;
413-
413+
delete req;
414414
}
415415

416416
void Connection::EIO_Execute(uv_work_t* req) {
@@ -705,6 +705,7 @@ void Connection::EIO_AfterExecute(uv_work_t* req, int status) {
705705
}
706706

707707
delete baton;
708+
delete req;
708709
}
709710

710711
void Connection::handleResult(ExecuteBaton* baton, Handle<Value> (&argv)[2]) {

src/oracle_bindings.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ void OracleClient::EIO_AfterConnect(uv_work_t* req, int status) {
148148
node::MakeCallback(Context::GetCurrent()->Global(), uni::Deref(baton->callback), 2, argv);
149149

150150
delete baton;
151+
delete req;
151152
}
152153

153154
uni::CallbackType OracleClient::ConnectSync(const uni::FunctionCallbackInfo& args) {

src/reader.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,5 +133,6 @@ void Reader::EIO_AfterNextRows(uv_work_t* req, int status) {
133133
// reader destructor will delete the baton and everything else.
134134
baton->ResetStatement();
135135
}
136+
delete req;
136137
}
137138

0 commit comments

Comments
 (0)