summaryrefslogtreecommitdiff
path: root/source3/tdb
diff options
context:
space:
mode:
authorMartin Pool <mbp@samba.org>2001-12-10 05:12:52 +0000
committerMartin Pool <mbp@samba.org>2001-12-10 05:12:52 +0000
commit77d800fb3ea28586a2c1385cffbf5b4314284f14 (patch)
treecedc7e6224163bd4114392f761fa69fd53508d5f /source3/tdb
parent70f27f1b52b57011c053460b0084e366bfbf03f7 (diff)
downloadsamba-77d800fb3ea28586a2c1385cffbf5b4314284f14.tar.gz
samba-77d800fb3ea28586a2c1385cffbf5b4314284f14.tar.bz2
samba-77d800fb3ea28586a2c1385cffbf5b4314284f14.zip
tdb_open_ex should always "goto fail" in case of error, rather than
just returning. I don't think this would leak at the moment, but it's an accident waiting to happen. (This used to be commit fe901ec194d1b8ef94386b097e72508075eb8a54)
Diffstat (limited to 'source3/tdb')
-rw-r--r--source3/tdb/tdb.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source3/tdb/tdb.c b/source3/tdb/tdb.c
index 955c0b322d..3b0946d580 100644
--- a/source3/tdb/tdb.c
+++ b/source3/tdb/tdb.c
@@ -1463,11 +1463,12 @@ TDB_CONTEXT *tdb_open_ex(char *name, int hash_size, int tdb_flags,
goto fail;
/* Is it already in the open list? If so, fail. */
+ if (tdb_already_open(st.st_dev, st.st_ino)
for (i = tdbs; i; i = i->next) {
if (i->device == st.st_dev && i->inode == st.st_ino) {
errno = EBUSY;
close(tdb->fd);
- return NULL;
+ goto fail;
}
}