summaryrefslogtreecommitdiff
path: root/libsmdb/smdb2.c
diff options
context:
space:
mode:
authorGregory Neil Shapiro <gshapiro@FreeBSD.org>2010-01-26 04:17:18 +0000
committerGregory Neil Shapiro <gshapiro@FreeBSD.org>2010-01-26 04:17:18 +0000
commit09b16018d032d94de7fbaf59c4d6fc4a43c4d610 (patch)
tree25902a53d874255d42002dd157e36601e71e2df5 /libsmdb/smdb2.c
parent7db286411e6127edcdd31f558ac20de5c63055b0 (diff)
Notes
Diffstat (limited to 'libsmdb/smdb2.c')
-rw-r--r--libsmdb/smdb2.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/libsmdb/smdb2.c b/libsmdb/smdb2.c
index be07d636b47f..15806619ee58 100644
--- a/libsmdb/smdb2.c
+++ b/libsmdb/smdb2.c
@@ -1,5 +1,5 @@
/*
-** Copyright (c) 1999-2003 Sendmail, Inc. and its suppliers.
+** Copyright (c) 1999-2003, 2009 Sendmail, Inc. and its suppliers.
** All rights reserved.
**
** By using this file, you agree to the terms and conditions set
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Id: smdb2.c,v 8.79 2003/06/13 21:33:11 ca Exp $")
+SM_RCSID("@(#)$Id: smdb2.c,v 8.80 2009/11/12 23:07:49 ca Exp $")
#include <fcntl.h>
#include <stdlib.h>
@@ -620,12 +620,13 @@ smdb_db_open(database, db_name, mode, mode_mask, sff, type, user_info, db_params
}
smdb_db = smdb_malloc_database();
- if (smdb_db == NULL)
- return SMDBE_MALLOC;
-
db2 = smdb2_malloc_database();
- if (db2 == NULL)
+ if (db2 == NULL || smdb_db == NULL)
+ {
+ smdb_unlock_file(lock_fd);
+ smdb_free_database(smdb_db); /* ok to be NULL */
return SMDBE_MALLOC;
+ }
db2->smdb2_lock_fd = lock_fd;