Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Confusing behavior for LL_SessionAllocEx(...) may cause memory leaks.

Status
Not open for further replies.

LaPiMg

Programmer
Oct 26, 2006
6
CA
Hi,

according to the LAPI documentation (9.7.0), when calling

LLSTATUS LL_SessionAllocEx(
LPLLSESSION newSession,
LLCSTR server,
LLLONG port,
LLCSTR connection,
LLCSTR userName,
LLCSTR userPassword,
LLVALUE config);

the newSession argument returns a Session handle.

However, if one of the parameters is wrong, for example server, it will return some error, (IE LL_E_COULDNOTCONNECT) but it still has a newSession handle. The problem, here is that one cannot call LL_SessionFree, using newSession as the argument, because the Session was never really created. And if you try another error will happen.

Did anyone came across this problem? Any ideas for the solution. If a handle was allocated, even though no session was created, can this cause memory leaks? Can we "nullify" the Session handle?

Any thoughts?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top