mirror of
https://github.com/samba-team/samba.git
synced 2025-03-09 08:58:35 +03:00
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)
This commit is contained in:
parent
70f27f1b52
commit
77d800fb3e
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user