summaryrefslogtreecommitdiffstats
path: root/src/kadmin
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2006-10-14 00:17:48 +0000
committerKen Raeburn <raeburn@mit.edu>2006-10-14 00:17:48 +0000
commit7b70e84576a8b2d39fddb57570cd505a433d0e24 (patch)
treef74d8298259301910e264586b172dec5058255f3 /src/kadmin
parent2720291460e1e211be215fddb8096e3ed1d9bb28 (diff)
downloadkrb5-7b70e84576a8b2d39fddb57570cd505a433d0e24.tar.gz
krb5-7b70e84576a8b2d39fddb57570cd505a433d0e24.tar.xz
krb5-7b70e84576a8b2d39fddb57570cd505a433d0e24.zip
Call fileno and krb5_lock_file before calling fclose, rather than after.
Caught by valgrind. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18700 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/kadmin')
-rw-r--r--src/kadmin/dbutil/dump.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/kadmin/dbutil/dump.c b/src/kadmin/dbutil/dump.c
index 12b6a46ef..e1f1d8848 100644
--- a/src/kadmin/dbutil/dump.c
+++ b/src/kadmin/dbutil/dump.c
@@ -1190,8 +1190,12 @@ dump_db(argc, argv)
exit_status++;
}
if (ofile && f != stdout && !exit_status) {
- fclose(f);
- update_ok_file(ofile);
+ if (locked) {
+ (void) krb5_lock_file(util_context, fileno(f), KRB5_LOCKMODE_UNLOCK);
+ locked = 0;
+ }
+ fclose(f);
+ update_ok_file(ofile);
}
}
if (locked)