From: Kevin Coffman Date: Fri, 16 Mar 2007 14:27:41 +0000 (-0400) Subject: Don't leak keytab entries X-Git-Tag: nfs-utils-1-1-0-rc1~53 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=3bfd8b18c743cc0908a70a7d401521250ade4776;p=nfs-utils.git Don't leak keytab entries Free keytab entries while processing keytab file. Signed-off-by: Kevin Coffman Signed-off-by: Neil Brown --- diff --git a/utils/gssd/krb5_util.c b/utils/gssd/krb5_util.c index 6af2869..cd777e4 100644 --- a/utils/gssd/krb5_util.c +++ b/utils/gssd/krb5_util.c @@ -485,6 +485,7 @@ gssd_process_krb5_keytab(krb5_context context, krb5_keytab kt, char *kt_name) printerr(0, "WARNING: Skipping keytab entry because " "we failed to unparse principal name: %s\n", error_message(code)); + krb5_kt_free_entry(context, &kte); continue; } printerr(2, "Processing keytab entry for principal '%s'\n", @@ -510,6 +511,7 @@ gssd_process_krb5_keytab(krb5_context context, krb5_keytab kt, char *kt_name) #else free(pname); #endif + krb5_kt_free_entry(context, &kte); retval = ENOMEM; goto out; } @@ -533,6 +535,7 @@ gssd_process_krb5_keytab(krb5_context context, krb5_keytab kt, char *kt_name) #else free(pname); #endif + krb5_kt_free_entry(context, &kte); retval = ENOMEM; goto out; } @@ -546,6 +549,7 @@ gssd_process_krb5_keytab(krb5_context context, krb5_keytab kt, char *kt_name) #else free(pname); #endif + krb5_kt_free_entry(context, &kte); retval = code; goto out; } @@ -565,6 +569,7 @@ gssd_process_krb5_keytab(krb5_context context, krb5_keytab kt, char *kt_name) #else free(pname); #endif + krb5_kt_free_entry(context, &kte); } if ((code = krb5_kt_end_seq_get(context, kt, &cursor))) {