summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2014-08-27 16:15:46 -0400
committerGreg Hudson <ghudson@mit.edu>2014-10-04 19:49:48 -0400
commit319d98bf13e8486f9f378ee47147c9c4bdb15c37 (patch)
treedf0deee04abed9285b13f45bbd56105006447b39
parentaf0ed4df4dfae762ab5fb605f5a0c8f59cb4f6ca (diff)
downloadkrb5-319d98bf13e8486f9f378ee47147c9c4bdb15c37.tar.gz
krb5-319d98bf13e8486f9f378ee47147c9c4bdb15c37.tar.xz
krb5-319d98bf13e8486f9f378ee47147c9c4bdb15c37.zip
Fix minor memory leak in klist (again)
Commit 6e51f9cc3152c8e419fe7f459bcf521d60358434 attempted to fix two minor memory leaks in klist, but one of the fixes was dead code. In do_ccache, free princ before we look at the code which terminated the loop, not after we have returned on either branch.
-rw-r--r--src/clients/klist/klist.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/clients/klist/klist.c b/src/clients/klist/klist.c
index 51eaa0793..9058e8f17 100644
--- a/src/clients/klist/klist.c
+++ b/src/clients/klist/klist.c
@@ -533,6 +533,7 @@ do_ccache(krb5_ccache cache)
}
krb5_free_cred_contents(kcontext, &creds);
}
+ krb5_free_principal(kcontext, princ);
if (code == KRB5_CC_END) {
if ((code = krb5_cc_end_seq_get(kcontext, cache, &cur))) {
if (!status_only)
@@ -555,7 +556,6 @@ do_ccache(krb5_ccache cache)
com_err(progname, code, _("while retrieving a ticket"));
return 1;
}
- krb5_free_principal(kcontext, princ);
}
char *