Linux NFS development
 help / color / mirror / Atom feed
* [PATCH 1/2] nfs-utils: Removed a number of Coverity Scan RESOURCE_LEAK errors
@ 2019-08-26 14:34 Steve Dickson
  2019-08-26 14:34 ` [PATCH 2/2] nfs-utils: Removed a number of Coverity Scan USE_AFTER_FREE errors Steve Dickson
  2019-08-26 17:53 ` [PATCH 1/2] nfs-utils: Removed a number of Coverity Scan RESOURCE_LEAK errors Steve Dickson
  0 siblings, 2 replies; 4+ messages in thread
From: Steve Dickson @ 2019-08-26 14:34 UTC (permalink / raw)
  To: Linux NFS Mailing list

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 support/nfsidmap/libnfsidmap.c | 3 +++
 utils/gssd/krb5_util.c         | 4 ++++
 2 files changed, 7 insertions(+)

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);
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-08-26 17:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-26 14:34 [PATCH 1/2] nfs-utils: Removed a number of Coverity Scan RESOURCE_LEAK errors Steve Dickson
2019-08-26 14:34 ` [PATCH 2/2] nfs-utils: Removed a number of Coverity Scan USE_AFTER_FREE errors Steve Dickson
2019-08-26 17:53   ` Steve Dickson
2019-08-26 17:53 ` [PATCH 1/2] nfs-utils: Removed a number of Coverity Scan RESOURCE_LEAK errors Steve Dickson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox