From: Douglas Bagnall Date: Wed, 31 Aug 2022 03:42:46 +0000 (+1200) Subject: ldb: ldb_build_search_req() check for a talloc failure X-Git-Tag: talloc-2.4.0~978 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53f6dbe03f7389242a6ebfaddc90bc39865b17fc;p=thirdparty%2Fsamba.git ldb: ldb_build_search_req() check for a talloc failure The failure in question would have to be a `talloc_strdup(dn, "")` in ldb_dn_from_ldb_val(). Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/lib/ldb/common/ldb.c b/lib/ldb/common/ldb.c index c2599a096b9..6145bc7e500 100644 --- a/lib/ldb/common/ldb.c +++ b/lib/ldb/common/ldb.c @@ -1467,6 +1467,10 @@ int ldb_build_search_req_ex(struct ldb_request **ret_req, req->operation = LDB_SEARCH; if (base == NULL) { req->op.search.base = ldb_dn_new(req, ldb, NULL); + if (req->op.search.base == NULL) { + ldb_oom(ldb); + return LDB_ERR_OPERATIONS_ERROR; + } } else { req->op.search.base = base; }