Tomas,
Thanks for the explanation. I missed the pam_set_data() point here. Yes, then it
shouldn't be any leak here.
- Amarnath
________________________________________
From: Tomas Mraz [tmraz(a)redhat.com]
Sent: Monday, August 03, 2015 11:38 AM
To: Valluri, Amarnath
Cc: pam-developers(a)lists.fedorahosted.org
Subject: Re: [Pam-developers] Memory leaks in pam_modutil_getpw/gr family of functions
On St, 2015-07-29 at 12:19 +0000, Valluri, Amarnath wrote:
Hello pam-devels,
In library code, the dynamically allocated(realloc) memory returned by
pam_modutil_getgrnam/pid() pma_modutil_getpwnam/uid() functions, ie.,
struct group*, struct passwd* respectively is never been freed, so it
leaks the memory quiet many modules which uses these functions.
Can someone help me understanding this, if this is intentional or a
bug?
The memory pointer is registered as pam data with pam_set_data and freed
via the cleanup function when pam_end() is called by the application.
So there is no memory leak.
--
Tomas Mraz
No matter how far down the wrong road you've gone, turn back.
Turkish proverb
(You'll never know whether the road is wrong though.)
---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki
Business Identity Code: 0357606 - 4
Domiciled in Helsinki
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.