From e8b0726411213acb133a25c14ab42020e4a8de68 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 15 Dec 2013 21:23:59 +0100 Subject: [PATCH] ldb: Fix 1138330 Dereference null return value Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- lib/ldb/common/ldb.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ldb/common/ldb.c b/lib/ldb/common/ldb.c index d2b873f0b51..e5fa81977a7 100644 --- a/lib/ldb/common/ldb.c +++ b/lib/ldb/common/ldb.c @@ -112,6 +112,10 @@ struct ldb_context *ldb_init(TALLOC_CTX *mem_ctx, struct tevent_context *ev_ctx) * having to provide their own private one explicitly */ if (ev_ctx == NULL) { ev_ctx = tevent_context_init(ldb); + if (ev_ctx == NULL) { + talloc_free(ldb); + return NULL; + } tevent_set_debug(ev_ctx, ldb_tevent_debug, ldb); tevent_loop_allow_nesting(ev_ctx); } -- 2.11.4.GIT