mirror of
https://github.com/samba-team/samba.git
synced 2025-03-03 12:58:35 +03:00
s3:smbd: remove pointless static variable in uid.c
We always free the value at the end of the function, so we don't need a static variable to hold just NULL for the time the function isn't executed. metze
This commit is contained in:
parent
9ae0c5e5a7
commit
0a0cd1396a
@ -28,13 +28,11 @@ extern struct current_user current_user;
|
||||
|
||||
bool change_to_guest(void)
|
||||
{
|
||||
static struct passwd *pass=NULL;
|
||||
struct passwd *pass;
|
||||
|
||||
pass = getpwnam_alloc(talloc_autofree_context(), lp_guestaccount());
|
||||
if (!pass) {
|
||||
/* Don't need to free() this as its stored in a static */
|
||||
pass = getpwnam_alloc(talloc_autofree_context(), lp_guestaccount());
|
||||
if (!pass)
|
||||
return(False);
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef AIX
|
||||
@ -49,9 +47,8 @@ bool change_to_guest(void)
|
||||
current_user.vuid = UID_FIELD_INVALID;
|
||||
|
||||
TALLOC_FREE(pass);
|
||||
pass = NULL;
|
||||
|
||||
return True;
|
||||
return true;
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
|
Loading…
x
Reference in New Issue
Block a user