From: Daniel Burrows Date: Sat, 31 Mar 2007 04:26:16 +0000 (-0700) Subject: Fix handling of DB4 hcache open failure. (closes: #2714) X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1d7e9450343c73862631637daec77daf26496898;p=neomutt Fix handling of DB4 hcache open failure. (closes: #2714) --- diff --git a/hcache.c b/hcache.c index b5b3d59e4..facf04eea 100644 --- a/hcache.c +++ b/hcache.c @@ -984,17 +984,13 @@ mutt_hcache_open(const char *path, const char *folder) ret = (*h->env->open)(h->env, NULL, DB_INIT_MPOOL | DB_CREATE | DB_PRIVATE, 0600); - if (!ret) + if (ret) { - ret = db_create(&h->db, h->env, 0); - if (ret) - { - h->env->close(h->env, 0); - mx_unlock_file(h->lockfile, h->fd, 0); - close(h->fd); - FREE(&h); - return NULL; - } + h->env->close(h->env, 0); + mx_unlock_file(h->lockfile, h->fd, 0); + close(h->fd); + FREE(&h); + return NULL; } if (stat(path, &sb) != 0 && errno == ENOENT)