Skip to content

Commit 231a4bc

Browse files
committed
Fix external authentication. Fix mem leaks with DATE/TIMESTAMP binds
1 parent 8d90c25 commit 231a4bc

File tree

3 files changed

+25
-24
lines changed

3 files changed

+25
-24
lines changed

src/njs/src/njsConnection.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1725,6 +1725,7 @@ void Connection::Async_Execute (uv_work_t *req)
17251725
{
17261726
bind->dttmarr->release () ;
17271727
bind->dttmarr = NULL;
1728+
bind->value = NULL;
17281729
}
17291730
}
17301731

@@ -2628,6 +2629,7 @@ NJSErrorType Connection::Descr2Double( Define* defines, unsigned int numCols,
26282629
if ( !getRS )
26292630
{
26302631
defines[col].dttmarr->release ();
2632+
defines[col].dttmarr = NULL;
26312633
defines[col].extbuf = NULL;
26322634
}
26332635
}

src/njs/src/njsConnection.h

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -235,30 +235,26 @@ typedef struct eBaton
235235
{
236236
for( unsigned int index = 0 ;index < binds.size(); index++ )
237237
{
238-
// donot free date value here, it is done in DateTimeArray functions
239-
if(binds[index]->type != DpiTimestampLTZ )
238+
// do not free refcursor type.
239+
if( binds[index]->value && binds[index]->type != DpiRSet )
240240
{
241-
// do not free refcursor type.
242-
if( binds[index]->value && binds[index]->type != DpiRSet )
243-
{
244-
free(binds[index]->value);
245-
}
246-
if ( binds[index]->extvalue )
247-
{
248-
free ( binds[index]->extvalue );
249-
}
250-
if ( binds[index]->ind )
251-
{
252-
free ( binds[index]->ind );
253-
}
254-
if ( binds[index]->len )
255-
{
256-
free ( binds[index]->len );
257-
}
258-
if ( binds[index]->len2 )
259-
{
260-
free ( binds[index]->len2 ) ;
261-
}
241+
free(binds[index]->value);
242+
}
243+
if ( binds[index]->extvalue )
244+
{
245+
free ( binds[index]->extvalue );
246+
}
247+
if ( binds[index]->ind )
248+
{
249+
free ( binds[index]->ind );
250+
}
251+
if ( binds[index]->len )
252+
{
253+
free ( binds[index]->len );
254+
}
255+
if ( binds[index]->len2 )
256+
{
257+
free ( binds[index]->len2 ) ;
262258
}
263259
delete binds[index];
264260
}

src/njs/src/njsOracle.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -989,6 +989,8 @@ void Oracledb::Async_CreatePool (uv_work_t *req)
989989

990990
try
991991
{
992+
// externAuth is not supported in homogeneous pool, in case app specified
993+
// externalAuth, then make it as heterogeneous pool.
992994
poolBaton->dpipool = poolBaton-> dpienv ->
993995
createPool ( poolBaton->user,
994996
poolBaton->pswrd,
@@ -998,7 +1000,8 @@ void Oracledb::Async_CreatePool (uv_work_t *req)
9981000
poolBaton->poolIncrement,
9991001
poolBaton->poolTimeout,
10001002
poolBaton->stmtCacheSize,
1001-
poolBaton->externalAuth );
1003+
poolBaton->externalAuth,
1004+
poolBaton->externalAuth ? false : true );
10021005
}
10031006
catch (dpi::Exception &e)
10041007
{

0 commit comments

Comments
 (0)