summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/common
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2011-04-04 10:26:47 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2011-04-07 15:53:20 +0200
commit32cad7601a55b2c232c4914ab382714f331ae218 (patch)
treead249a0ac42dc4865f83704842701514d4efb183 /source4/lib/ldb/common
parent1d8980df0494af975278954dce4b24605602ed6f (diff)
downloadsamba-32cad7601a55b2c232c4914ab382714f331ae218.tar.gz
samba-32cad7601a55b2c232c4914ab382714f331ae218.tar.bz2
samba-32cad7601a55b2c232c4914ab382714f331ae218.zip
ldb:common/*.c - check for some OOM conditions
Reviewed-by: abartlet
Diffstat (limited to 'source4/lib/ldb/common')
-rw-r--r--source4/lib/ldb/common/ldb.c4
-rw-r--r--source4/lib/ldb/common/ldb_modules.c3
2 files changed, 7 insertions, 0 deletions
diff --git a/source4/lib/ldb/common/ldb.c b/source4/lib/ldb/common/ldb.c
index d902482de0..0aadeb0d30 100644
--- a/source4/lib/ldb/common/ldb.c
+++ b/source4/lib/ldb/common/ldb.c
@@ -104,6 +104,10 @@ struct ldb_context *ldb_init(TALLOC_CTX *mem_ctx, struct tevent_context *ev_ctx)
}
ldb = talloc_zero(mem_ctx, struct ldb_context);
+ if (ldb == NULL) {
+ return NULL;
+ }
+
/* A new event context so that callers who don't want ldb
* operating on thier global event context can work without
* having to provide their own private one explicitly */
diff --git a/source4/lib/ldb/common/ldb_modules.c b/source4/lib/ldb/common/ldb_modules.c
index b382a91ec8..d07666a674 100644
--- a/source4/lib/ldb/common/ldb_modules.c
+++ b/source4/lib/ldb/common/ldb_modules.c
@@ -200,6 +200,9 @@ int ldb_module_connect_backend(struct ldb_context *ldb,
/* Default to tdb */
backend = talloc_strdup(ldb, "tdb");
}
+ if (backend == NULL) {
+ return ldb_oom(ldb);
+ }
be = ldb_find_backend(backend);