krb5 commit: Fix recent memory leak in locate_kdc.c
Greg Hudson
ghudson at mit.edu
Wed Jun 29 13:26:46 EDT 2016
https://github.com/krb5/krb5/commit/ebb59a92cc831dfef73dc41f8be6ccee68359300
commit ebb59a92cc831dfef73dc41f8be6ccee68359300
Author: Greg Hudson <ghudson at mit.edu>
Date: Tue Jun 21 18:46:28 2016 -0400
Fix recent memory leak in locate_kdc.c
Commit ce112dec844e4650b5ad174bd40f21c32aebe1d1 introduced a memory
leak in locate_srv_conf_1() by moving the free(realmstr) call to the
cleanup handler, because there was an early return after realmstr is
allocated. Convert that early return to a goto.
src/lib/krb5/os/locate_kdc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/lib/krb5/os/locate_kdc.c b/src/lib/krb5/os/locate_kdc.c
index cd48627..6d4416c 100644
--- a/src/lib/krb5/os/locate_kdc.c
+++ b/src/lib/krb5/os/locate_kdc.c
@@ -240,7 +240,7 @@ locate_srv_conf_1(krb5_context context, const krb5_data *realm,
error_message(code));
if (code == PROF_NO_SECTION || code == PROF_NO_RELATION)
code = 0;
- return code;
+ goto cleanup;
}
for (i=0; hostlist[i]; i++) {
More information about the cvs-krb5
mailing list