From c5ac9b9af684f61c4fc51ab6360741547cdc7e15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Thu, 23 Jun 2005 13:34:17 +0000 Subject: [PATCH] (DB_open): in case of error, close database git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15508 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/hdb/db.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/hdb/db.c b/lib/hdb/db.c index 497422a80..614edcffe 100644 --- a/lib/hdb/db.c +++ b/lib/hdb/db.c @@ -256,6 +256,13 @@ DB_open(krb5_context context, HDB *db, int flags, mode_t mode) krb5_clear_error_string(context); return 0; } + if (ret) { + DB_close(context, db); + krb5_set_error_string(context, "hdb_open: failed %s database %s", + (flags & O_ACCMODE) == O_RDONLY ? + "checking format of" : "initialize", + db->hdb_name); + } return ret; }