[PATCH] Call TALLOC_FREE() before we return otherwise we will never free sam_account

Jeremy Allison jra at samba.org
Mon Sep 10 15:59:10 MDT 2012


On Sun, Sep 09, 2012 at 08:33:36PM +0200, Michele Baldessari wrote:
> 
> ---
>  source3/utils/pdbedit.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/source3/utils/pdbedit.c b/source3/utils/pdbedit.c
> index 8a3551b..908f0ba 100644
> --- a/source3/utils/pdbedit.c
> +++ b/source3/utils/pdbedit.c
> @@ -965,8 +965,8 @@ static int delete_machine_entry(const char *machinename)
>  	if (!pdb_getsampwnam(samaccount, name)) {
>  		fprintf (stderr,
>  			 "machine %s does not exist in the passdb\n", name);
> -		return -1;
>  		TALLOC_FREE(samaccount);
> +		return -1;
>  	}
>  
>  	if (!NT_STATUS_IS_OK(pdb_delete_sam_account(samaccount))) {
> -- 
> 1.7.11.4

Pushed - thanks !


More information about the samba-technical mailing list