Re: [PATCH 1/2] nfs-utils: Removed a number of Coverity Scan RESOURCE_LEAK errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 8/26/19 10:34 AM, Steve Dickson wrote:
> Signed-off-by: Steve Dickson <steved@xxxxxxxxxx>
> ---
>  support/nfsidmap/libnfsidmap.c | 3 +++
>  utils/gssd/krb5_util.c         | 4 ++++
>  2 files changed, 7 insertions(+)
Committed...

steved.

> 
> diff --git a/support/nfsidmap/libnfsidmap.c b/support/nfsidmap/libnfsidmap.c
> index 7b8a871..9299e65 100644
> --- a/support/nfsidmap/libnfsidmap.c
> +++ b/support/nfsidmap/libnfsidmap.c
> @@ -486,6 +486,9 @@ out:
>  	if (gss_methods)
>  		conf_free_list(gss_methods);
>  
> +	if (nfs4_methods)
> +		conf_free_list(nfs4_methods);
> +
>  	return ret ? -ENOENT: 0;
>  }
>  
> diff --git a/utils/gssd/krb5_util.c b/utils/gssd/krb5_util.c
> index 454a6eb..f68be85 100644
> --- a/utils/gssd/krb5_util.c
> +++ b/utils/gssd/krb5_util.c
> @@ -912,6 +912,8 @@ find_keytab_entry(krb5_context context, krb5_keytab kt,
>  				k5err = gssd_k5_err_msg(context, code);
>  				printerr(3, "%s while getting keytab entry for '%s'\n",
>  					 k5err, spn);
> +				free(k5err);
> +				k5err = NULL;
>  				/*
>  				 * We tried the active directory machine account
>  				 * with the hostname part as-is and failed...
> @@ -1231,6 +1233,8 @@ gssd_destroy_krb5_machine_creds(void)
>  			k5err = gssd_k5_err_msg(context, code);
>  			printerr(0, "WARNING: %s while destroying credential "
>  				    "cache '%s'\n", k5err, ple->ccname);
> +			free(k5err);
> +			k5err = NULL;
>  		}
>  	}
>  	krb5_free_context(context);
> 



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux