mirror of
https://github.com/samba-team/samba.git
synced 2025-02-25 17:57:42 +03:00
move to SAFE_FREE()
(This used to be commit 64d35e94fe6f7e56353b286162f670c8595a90e6)
This commit is contained in:
parent
84ab9d2cb3
commit
4561e8a8ea
@ -159,7 +159,7 @@ static int smb_pam_conv(int num_msg,
|
||||
|
||||
default:
|
||||
/* Must be an error of some sort... */
|
||||
free(reply);
|
||||
SAFE_FREE(reply);
|
||||
return PAM_CONV_ERR;
|
||||
}
|
||||
}
|
||||
@ -250,7 +250,7 @@ static void free_pw_chat(struct chat_struct *list)
|
||||
while (list) {
|
||||
struct chat_struct *old_head = list;
|
||||
DLIST_REMOVE(list, list);
|
||||
free(old_head);
|
||||
SAFE_FREE(old_head);
|
||||
}
|
||||
}
|
||||
|
||||
@ -325,8 +325,7 @@ static int smb_pam_passchange_conv(int num_msg,
|
||||
if (!found) {
|
||||
DEBUG(3,("smb_pam_passchange_conv: Could not find reply for PAM prompt: %s\n",msg[replies]->msg));
|
||||
free_pw_chat(pw_chat);
|
||||
free(reply);
|
||||
reply = NULL;
|
||||
SAFE_FREE(reply);
|
||||
return PAM_CONV_ERR;
|
||||
}
|
||||
break;
|
||||
@ -358,8 +357,7 @@ static int smb_pam_passchange_conv(int num_msg,
|
||||
if (!found) {
|
||||
DEBUG(3,("smb_pam_passchange_conv: Could not find reply for PAM prompt: %s\n",msg[replies]->msg));
|
||||
free_pw_chat(pw_chat);
|
||||
free(reply);
|
||||
reply = NULL;
|
||||
SAFE_FREE(reply);
|
||||
return PAM_CONV_ERR;
|
||||
}
|
||||
break;
|
||||
@ -376,8 +374,7 @@ static int smb_pam_passchange_conv(int num_msg,
|
||||
default:
|
||||
/* Must be an error of some sort... */
|
||||
free_pw_chat(pw_chat);
|
||||
free(reply);
|
||||
reply = NULL;
|
||||
SAFE_FREE(reply);
|
||||
return PAM_CONV_ERR;
|
||||
}
|
||||
}
|
||||
@ -395,9 +392,9 @@ static int smb_pam_passchange_conv(int num_msg,
|
||||
static void smb_free_pam_conv(struct pam_conv *pconv)
|
||||
{
|
||||
if (pconv)
|
||||
safe_free(pconv->appdata_ptr);
|
||||
SAFE_FREE(pconv->appdata_ptr);
|
||||
|
||||
safe_free(pconv);
|
||||
SAFE_FREE(pconv);
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
@ -411,8 +408,8 @@ static struct pam_conv *smb_setup_pam_conv(smb_pam_conv_fn smb_pam_conv_fnptr, c
|
||||
struct smb_pam_userdata *udp = (struct smb_pam_userdata *)malloc(sizeof(struct smb_pam_userdata));
|
||||
|
||||
if (pconv == NULL || udp == NULL) {
|
||||
safe_free(pconv);
|
||||
safe_free(udp);
|
||||
SAFE_FREE(pconv);
|
||||
SAFE_FREE(udp);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -159,7 +159,7 @@ static int smb_pam_conv(int num_msg,
|
||||
|
||||
default:
|
||||
/* Must be an error of some sort... */
|
||||
free(reply);
|
||||
SAFE_FREE(reply);
|
||||
return PAM_CONV_ERR;
|
||||
}
|
||||
}
|
||||
@ -250,7 +250,7 @@ static void free_pw_chat(struct chat_struct *list)
|
||||
while (list) {
|
||||
struct chat_struct *old_head = list;
|
||||
DLIST_REMOVE(list, list);
|
||||
free(old_head);
|
||||
SAFE_FREE(old_head);
|
||||
}
|
||||
}
|
||||
|
||||
@ -325,8 +325,7 @@ static int smb_pam_passchange_conv(int num_msg,
|
||||
if (!found) {
|
||||
DEBUG(3,("smb_pam_passchange_conv: Could not find reply for PAM prompt: %s\n",msg[replies]->msg));
|
||||
free_pw_chat(pw_chat);
|
||||
free(reply);
|
||||
reply = NULL;
|
||||
SAFE_FREE(reply);
|
||||
return PAM_CONV_ERR;
|
||||
}
|
||||
break;
|
||||
@ -358,8 +357,7 @@ static int smb_pam_passchange_conv(int num_msg,
|
||||
if (!found) {
|
||||
DEBUG(3,("smb_pam_passchange_conv: Could not find reply for PAM prompt: %s\n",msg[replies]->msg));
|
||||
free_pw_chat(pw_chat);
|
||||
free(reply);
|
||||
reply = NULL;
|
||||
SAFE_FREE(reply);
|
||||
return PAM_CONV_ERR;
|
||||
}
|
||||
break;
|
||||
@ -376,8 +374,7 @@ static int smb_pam_passchange_conv(int num_msg,
|
||||
default:
|
||||
/* Must be an error of some sort... */
|
||||
free_pw_chat(pw_chat);
|
||||
free(reply);
|
||||
reply = NULL;
|
||||
SAFE_FREE(reply);
|
||||
return PAM_CONV_ERR;
|
||||
}
|
||||
}
|
||||
@ -395,9 +392,9 @@ static int smb_pam_passchange_conv(int num_msg,
|
||||
static void smb_free_pam_conv(struct pam_conv *pconv)
|
||||
{
|
||||
if (pconv)
|
||||
safe_free(pconv->appdata_ptr);
|
||||
SAFE_FREE(pconv->appdata_ptr);
|
||||
|
||||
safe_free(pconv);
|
||||
SAFE_FREE(pconv);
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
@ -411,8 +408,8 @@ static struct pam_conv *smb_setup_pam_conv(smb_pam_conv_fn smb_pam_conv_fnptr, c
|
||||
struct smb_pam_userdata *udp = (struct smb_pam_userdata *)malloc(sizeof(struct smb_pam_userdata));
|
||||
|
||||
if (pconv == NULL || udp == NULL) {
|
||||
safe_free(pconv);
|
||||
safe_free(udp);
|
||||
SAFE_FREE(pconv);
|
||||
SAFE_FREE(udp);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -150,14 +150,9 @@ BOOL pdb_free_sam(SAM_ACCOUNT *user)
|
||||
return False;
|
||||
}
|
||||
|
||||
if (user->nt_pw)
|
||||
free(user->nt_pw);
|
||||
|
||||
if (user->lm_pw)
|
||||
free(user->lm_pw);
|
||||
|
||||
free(user);
|
||||
user = NULL;
|
||||
SAFE_FREE(user->nt_pw);
|
||||
SAFE_FREE(user->lm_pw);
|
||||
SAFE_FREE(user);
|
||||
|
||||
return True;
|
||||
}
|
||||
@ -173,12 +168,8 @@ BOOL pdb_reset_sam(SAM_ACCOUNT *user)
|
||||
return False;
|
||||
}
|
||||
|
||||
if (user->nt_pw)
|
||||
free(user->nt_pw);
|
||||
|
||||
if (user->lm_pw)
|
||||
free(user->lm_pw);
|
||||
|
||||
SAFE_FREE(user->nt_pw);
|
||||
SAFE_FREE(user->lm_pw);
|
||||
ZERO_STRUCTP(user);
|
||||
|
||||
return True;
|
||||
|
@ -640,11 +640,11 @@ Error was %s. Password file may be corrupt ! Please examine by hand !\n",
|
||||
}
|
||||
|
||||
endsmbfilepwent(fp, &pw_file_lock_depth);
|
||||
free(new_entry);
|
||||
SAFE_FREE(new_entry);
|
||||
return False;
|
||||
}
|
||||
|
||||
free(new_entry);
|
||||
SAFE_FREE(new_entry);
|
||||
endsmbfilepwent(fp, &pw_file_lock_depth);
|
||||
return True;
|
||||
}
|
||||
@ -1121,11 +1121,11 @@ Error was %s\n", pwd->smb_name, pfile2, strerror(errno)));
|
||||
unlink(pfile2);
|
||||
endsmbfilepwent(fp, &pw_file_lock_depth);
|
||||
endsmbfilepwent(fp_write, &pfile2_lockdepth);
|
||||
free(new_entry);
|
||||
SAFE_FREE(new_entry);
|
||||
return False;
|
||||
}
|
||||
|
||||
free(new_entry);
|
||||
SAFE_FREE(new_entry);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -331,7 +331,7 @@ static uint32 init_buffer_from_sam (uint8 **buf, SAM_ACCOUNT *sampass)
|
||||
if (buflen != len)
|
||||
{
|
||||
/* error */
|
||||
free (*buf);
|
||||
SAFE_FREE (*buf);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
|
@ -106,12 +106,12 @@ BOOL secrets_fetch_domain_sid(char *domain, DOM_SID *sid)
|
||||
|
||||
if (size != sizeof(DOM_SID))
|
||||
{
|
||||
free(dyn_sid);
|
||||
SAFE_FREE(dyn_sid);
|
||||
return False;
|
||||
}
|
||||
|
||||
*sid = *dyn_sid;
|
||||
free(dyn_sid);
|
||||
SAFE_FREE(dyn_sid);
|
||||
return True;
|
||||
}
|
||||
|
||||
@ -145,7 +145,7 @@ BOOL secrets_fetch_trust_account_password(char *domain, uint8 ret_pwd[16],
|
||||
|
||||
if (pass_last_set_time) *pass_last_set_time = pass->mod_time;
|
||||
memcpy(ret_pwd, pass->hash, 16);
|
||||
free(pass);
|
||||
SAFE_FREE(pass);
|
||||
return True;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user