]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
r19146: merge from samba3:
authorStefan Metzmacher <metze@samba.org>
Fri, 6 Oct 2006 16:17:19 +0000 (16:17 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:20:43 +0000 (14:20 -0500)
talloc_reference() can fail

metze
(This used to be commit 542cd5d029e97c2e0c7c006a1ced12114c1bb6da)

source4/lib/ldb/ldb_tdb/ldb_tdb_wrap.c

index b28bf7745077c63e496ca39bc43ec46c07bfb984..c9eac013fcf0cb2a0fe817570b00f06564353fda 100644 (file)
@@ -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;
                        }
                }