From 09bca9fed88e515944d6384f6ea0b973ae964a67 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Sat, 31 Jan 2009 01:07:04 +0000 Subject: [PATCH] recode as more straight-line code to simplify analysis git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21848 dc483132-0cff-0310-8789-dd5450dbe970 --- src/plugins/kdb/db2/kdb_db2.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/plugins/kdb/db2/kdb_db2.c b/src/plugins/kdb/db2/kdb_db2.c index 90c893305..85828095c 100644 --- a/src/plugins/kdb/db2/kdb_db2.c +++ b/src/plugins/kdb/db2/kdb_db2.c @@ -1197,6 +1197,8 @@ krb5_db2_db_iterate_ext(krb5_context context, #endif } while (dbret == 0) { + krb5_error_code retval2; + contdata.data = contents.data; contdata.length = contents.size; retval = krb5_decode_princ_contents(context, &contdata, &entries); @@ -1207,16 +1209,16 @@ krb5_db2_db_iterate_ext(krb5_context context, break; retval = (*func) (func_arg, &entries); krb5_dbe_free_contents(context, &entries); + retval2 = k5_mutex_lock(krb5_db2_mutex); /* Note: If re-locking fails, the wrapper in db2_exp.c will still try to unlock it again. That would be a bug. Fix when integrating the locking better. */ - if (retval) { - (void) k5_mutex_lock(krb5_db2_mutex); - break; - } - retval = k5_mutex_lock(krb5_db2_mutex); if (retval) break; + if (retval2) { + retval = retval2; + break; + } if (!recursive) { dbret = (*db->seq) (db, &key, &contents, backwards ? R_PREV : R_NEXT); -- 2.26.2