|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
SecurityExit Buffer Memory Allocation Rules |
« View previous topic :: View next topic » |
Author |
Message
|
mfuini |
Posted: Tue Feb 15, 2005 1:33 pm Post subject: SecurityExit Buffer Memory Allocation Rules |
|
|
Novice
Joined: 20 Jan 2005 Posts: 15
|
Can anyone help me find the documentation on who is supposed to free the memory created and returned in the buffers for the ChannelExit API?
I have seen some code where the memory is always Freed upon entering the function.
What is the general rule?
void MQENTRY SecurityChannelExit (PMQVOID channelExitParms,
PMQVOID channelDef,
PMQLONG dataLength,
PMQLONG agBufLength,
PMQVOID agBuf,
PMQLONG exitBufLength, PMQPTR exitBufAddr)
{
....
FreeExitBuffer (exitBufAddr, exitBufLength);
} _________________ Mark Fuini
markfuini@yahoo.com |
|
Back to top |
|
 |
RogerLacroix |
Posted: Tue Feb 15, 2005 9:39 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
Hi,
Rule # 1 - If you allocate it then you free it.
Hint - that is why there is an initialization & termination ExitReason codes in the exit.
Regards,
Roger Lacroix _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
mfuini |
Posted: Wed Feb 16, 2005 6:39 am Post subject: |
|
|
Novice
Joined: 20 Jan 2005 Posts: 15
|
Thanks Roger!!
Do you free it when the code is TERM? I have only seen the free done at the beginning of the function if the pointer is not null.
FreeExitBuffer( pExitBufferAddr, pExitBufferLength );
switch ( pChlExParms->ExitReason )
{
case MQXR_INIT:
...
break;
case MQXR_TERM:
....
break;
case MQXR_INIT_SEC:
switch ( pChDef->ChannelType )
{
case MQCHT_SENDER:
...
buf = AllocExitBuffer( buflen ); _________________ Mark Fuini
markfuini@yahoo.com |
|
Back to top |
|
 |
RogerLacroix |
Posted: Wed Feb 16, 2005 9:08 am Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|