diff options
author | Martin Pool <mbp@samba.org> | 2001-12-10 05:12:52 +0000 |
---|---|---|
committer | Martin Pool <mbp@samba.org> | 2001-12-10 05:12:52 +0000 |
commit | fe901ec194d1b8ef94386b097e72508075eb8a54 (patch) | |
tree | 76619b1105dafb2e6fa5f57f7ff51c8c8493c2aa | |
parent | bb6c0df4bc4eb8ce789886ec17e434dc27bb34b0 (diff) | |
download | samba-fe901ec194d1b8ef94386b097e72508075eb8a54.tar.gz |
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.
-rw-r--r-- | source/tdb/tdb.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/tdb/tdb.c b/source/tdb/tdb.c index 955c0b322df..3b0946d5804 100644 --- a/source/tdb/tdb.c +++ b/source/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; } } |