git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bb6c0df
)
tdb_open_ex should always "goto fail" in case of error, rather than
author
Martin Pool
<mbp@samba.org>
Mon, 10 Dec 2001 05:12:52 +0000
(
05:12
+0000)
committer
Martin Pool
<mbp@samba.org>
Mon, 10 Dec 2001 05:12:52 +0000
(
05:12
+0000)
just returning. I don't think this would leak at the moment, but it's
an accident waiting to happen.
source/tdb/tdb.c
patch
|
blob
|
history
diff --git
a/source/tdb/tdb.c
b/source/tdb/tdb.c
index 955c0b322dfc0957874e6dab5933960ba642478a..3b0946d58041bd0b349482bcfeb598c73342df8f 100644
(file)
--- 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
;
}
}