aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Kuthan <tkuthan@gmail.com>2014-04-02 17:48:04 +0200
committerTom Yu <tlyu@mit.edu>2015-02-06 17:06:36 -0500
commitaaaef80edb4746ae2d631c669073a7eaa91dfdbb (patch)
tree300268325b0bbbc026878bdf59412aefdd0ec554
parent98b8fddd856bbbacf351755ac03187550c4dd157 (diff)
downloadkrb5-aaaef80edb4746ae2d631c669073a7eaa91dfdbb.zip
krb5-aaaef80edb4746ae2d631c669073a7eaa91dfdbb.tar.gz
krb5-aaaef80edb4746ae2d631c669073a7eaa91dfdbb.tar.bz2
Fix leak in kadm5_flush with LDAP KDB
Due to an inverted test in adb_policy_init, kadm5_flush calls krb5_db_open twice. With the DB2 KDB module, the second open is a no-op, but with the LDAP module, a new DB handle is allocated and the old one is leaked. [ghudson@mit.edu: rewrote commit message] (cherry picked from commit 372e4cb6f5d4a603e6e3157c7b5d354953836136) ticket: 8096 (new) version_fixed: 1.11.6 status: resolved
-rw-r--r--src/lib/kadm5/srv/server_misc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/kadm5/srv/server_misc.c b/src/lib/kadm5/srv/server_misc.c
index 30a0b5a..18d047b 100644
--- a/src/lib/kadm5/srv/server_misc.c
+++ b/src/lib/kadm5/srv/server_misc.c
@@ -38,7 +38,7 @@ kadm5_ret_t
adb_policy_init(kadm5_server_handle_t handle)
{
/* now policy is initialized as part of database. No seperate call needed */
- if( krb5_db_inited( handle->context ) )
+ if (krb5_db_inited(handle->context) == 0)
return KADM5_OK;
return krb5_db_open( handle->context, NULL,