summaryrefslogtreecommitdiff
path: root/source3/lib/ldb/ldb_tdb
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-10-06 16:14:41 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:15:16 -0500
commitb61d1e665e4f4bf0b8e2d3bdc8fa1135279a903d (patch)
tree4746f91d8b1a1c3f5c4e5f23dafaefd4e15bfdca /source3/lib/ldb/ldb_tdb
parentadc299bd0863a42f699874f1933dbace3abea316 (diff)
downloadsamba-b61d1e665e4f4bf0b8e2d3bdc8fa1135279a903d.tar.gz
samba-b61d1e665e4f4bf0b8e2d3bdc8fa1135279a903d.tar.bz2
samba-b61d1e665e4f4bf0b8e2d3bdc8fa1135279a903d.zip
r19145: talloc_reference() can fail!
metze (This used to be commit e4f2183684da90a67bc6a635d008b72a6dd3d0dd)
Diffstat (limited to 'source3/lib/ldb/ldb_tdb')
-rw-r--r--source3/lib/ldb/ldb_tdb/ldb_tdb_wrap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/lib/ldb/ldb_tdb/ldb_tdb_wrap.c b/source3/lib/ldb/ldb_tdb/ldb_tdb_wrap.c
index b28bf77450..c9eac013fc 100644
--- a/source3/lib/ldb/ldb_tdb/ldb_tdb_wrap.c
+++ b/source3/lib/ldb/ldb_tdb/ldb_tdb_wrap.c
@@ -134,7 +134,9 @@ struct tdb_context *ltdb_wrap_open(TALLOC_CTX *mem_ctx,
if (stat(path, &st) == 0) {
for (w=tdb_list;w;w=w->next) {
if (st.st_dev == w->device && st.st_ino == w->inode) {
- talloc_reference(mem_ctx, w);
+ if (!talloc_reference(mem_ctx, w)) {
+ return NULL;
+ }
return w->tdb;
}
}