CVS update: samba/source/nsswitch

Andrew Bartlett abartlet at
Sun Nov 2 23:51:36 GMT 2003

On Sun, Nov 02, 2003 at 04:22:28PM +0000, tpot at wrote:
> Date:	Sun Nov  2 16:22:28 2003
> Author:	tpot
> Update of /data/cvs/samba/source/nsswitch
> In directory
> Modified Files:
>       Tag: SAMBA_3_0
> 	wb_common.c 
> Log Message:
> Use putenv() instead of setenv() in the winbind_{off,on}() functions.  Some
> platforms don't have setenv().

My manpage for putenv() indicates (I think...) that a copy of the
string is *not* used, and as such the string should remain in memory
as long as the environment variable is set.  Your code calls free()
right after it is set.

The thing that has me confused is why we need to malloc anything here
at all.  Why not just use two constant strings, firm in the knowledge
that they never need to be allocated or free()ed.

Andrew Bartlett

More information about the samba-technical mailing list